bcc blink-dev

A paint-under-invalidation means that a DisplayItemClient (normally a
LayoutObject) has not been invalidated (via DisplayItemClient::Invalidate)
while its painted result will change. In production (with
under-invalidation checking disabled by default) that may cause stale
painting displayed. For some web tests, we enable under-invalidaton
checking to crash on such problems. See this doc
<https://chromium.googlesource.com/chromium/src/+/main/third_party/blink/renderer/core/paint/README.md#paint-invalidation>
for more details about paint invalidation.

In your case, the DisplayItemClient is "LayoutHTMLCanvas CANVAS
id='canvas'". It painted an empty foreground in the previous document life
cycle, and paints (forced by under-invalidation checking) an image rect in
the current cycle, but it has not been invalidated. If under-invalidation
checking is disabled, you'll see missing image rect.

Based on the code, I guess canvas() changed from false to true in the
current cycle, but we don't invalidate in this case. We seem to have some
code (maybe in HTMLCanvasElement) that invalidates the DisplayItemClient
when IsPaintable() changes, so the previous code works.

I think you just need to call SetShouldDoFullPaintInvalidation when
canvas() changes.


On Tue, Jan 28, 2025 at 4:49 AM Colin Blundell <blund...@chromium.org>
wrote:

> Hi Xianzhu and blink-dev@,
>
> I'm in the last stages of eliminating Canvas2DLayerBridge. At this point
> the primary blocker is Canvas2D code that checks for the existence of the
> bridge as a proxy to determine whether task <foo> is doable.
>
> In putting together a POC changing these callsites, I've hit one issue,
> which I've isolated down to a minimal CL
> <https://chromium-review.googlesource.com/c/chromium/src/+/6203066>: If I
> align CanvasRenderingContext2D::FinalizeFrame() with
> OffscreenCanvasRenderingContext2D::FinalizeFrame() in being guarded only by
> the canvas not being null (rather than CanvasRC2D's current check of the
> canvas *and* its bridge not being null), I hit a 
> PaintUnderInvalidationChecker::CheckNewItem()
> error
> <https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/graphics/paint/paint_under_invalidation_checker.cc;l=82-83;drc=27d34700b83f381c62e3a348de2e6dfdc08364b8>
> in this test
> <https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/fast/canvas/canvas-resize-after-paint-without-layout.html;l=1?q=canvas-resize-after-paint-wit&ss=chromium>.
> The CL gives the full details.
>
> I don't have any real insight into what this failure is signaling at a
> higher level. Would you be able to provide insight on whether it indicates
> (a) that the change is actually problematic or (b) that there is a problem
> to fix with the check and/or test infrastructure that this change is
> tickling?
>
> Thanks,
>
> Colin
>

-- 
You received this message because you are subscribed to the Google Groups 
"blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to blink-dev+unsubscr...@chromium.org.
To view this discussion visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADBxrifEHU35WD2HnYXF2EDHQ--WcKseWt_%3DPpndrU_Q002ZDw%40mail.gmail.com.

Reply via email to