Fix OffscreenCanvas::PushFrame damage rect [chromium/src : main]

0 views
Skip to first unread message

Vasiliy Telezhnikov (Gerrit)

unread,
Mar 20, 2026, 4:44:52 PM (3 days ago) Mar 20
to Colin Blundell, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, kainin...@chromium.org
Attention needed from Colin Blundell

Vasiliy Telezhnikov added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Vasiliy Telezhnikov . resolved

Please, take a look.

Ignore the CL chain, I likely will abandon them, I don't like where it ending up to be and will go the opposite direction.

Open in Gerrit

Related details

Attention is currently required from:
  • Colin Blundell
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Gerrit-Change-Number: 7681273
Gerrit-PatchSet: 3
Gerrit-Owner: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Attention: Colin Blundell <blun...@chromium.org>
Gerrit-Comment-Date: Fri, 20 Mar 2026 20:44:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Colin Blundell (Gerrit)

unread,
4:20 AM (15 hours ago) 4:20 AM
to Vasiliy Telezhnikov, Colin Blundell, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, kainin...@chromium.org
Attention needed from Vasiliy Telezhnikov

Colin Blundell voted and added 2 comments

Votes added by Colin Blundell

Code-Review+1

2 comments

Patchset-level comments
Colin Blundell . resolved

Thanks!

Commit Message
Line 19, Patchset 3 (Latest):check is incorrect and we should remove it.
Colin Blundell . resolved

This is a doozy. Am I understanding correctly that this means that WebGL won't actually draw to the screen for offscreen canvas in cases where the drawing buffer size is smaller than the canvas size?

I also don't understand how OffscreenCanvas2D works [at all](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc;l=422;drc=23c1350a5eb632830a9ece307987fdd6816893f1;bpv=1;bpt=1) - am I missing something there?

Open in Gerrit

Related details

Attention is currently required from:
  • Vasiliy Telezhnikov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Gerrit-Change-Number: 7681273
Gerrit-PatchSet: 3
Gerrit-Owner: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Mon, 23 Mar 2026 08:20:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Colin Blundell (Gerrit)

unread,
9:18 AM (10 hours ago) 9:18 AM
to Vasiliy Telezhnikov, Colin Blundell, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, kainin...@chromium.org
Attention needed from Vasiliy Telezhnikov

Colin Blundell added 1 comment

Commit Message
Line 19, Patchset 3 (Latest):check is incorrect and we should remove it.
Colin Blundell . resolved

This is a doozy. Am I understanding correctly that this means that WebGL won't actually draw to the screen for offscreen canvas in cases where the drawing buffer size is smaller than the canvas size?

I also don't understand how OffscreenCanvas2D works [at all](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc;l=422;drc=23c1350a5eb632830a9ece307987fdd6816893f1;bpv=1;bpt=1) - am I missing something there?

Colin Blundell

Actually, pursuing this further, this CL is [*not*](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc;l=1465-1479?q=DrawingBuffer::Ad&ss=chromium) a no-op for WebGL, is it? We'll now draw to the screen in cases where we wouldn't before. It's not clear to me what happens for the pixels not covered by the drawing buffer? (This overlaps with my workstream for marking external writes as complete overwrites).

Open in Gerrit

Related details

Attention is currently required from:
  • Vasiliy Telezhnikov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Gerrit-Change-Number: 7681273
Gerrit-PatchSet: 3
Gerrit-Owner: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Mon, 23 Mar 2026 13:18:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Colin Blundell <blun...@chromium.org>
satisfied_requirement
open
diffy

Vasiliy Telezhnikov (Gerrit)

unread,
10:01 AM (9 hours ago) 10:01 AM
to Colin Blundell, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, kainin...@chromium.org

Vasiliy Telezhnikov added 1 comment

Commit Message
Line 19, Patchset 3 (Latest):check is incorrect and we should remove it.
Colin Blundell . resolved

This is a doozy. Am I understanding correctly that this means that WebGL won't actually draw to the screen for offscreen canvas in cases where the drawing buffer size is smaller than the canvas size?

I also don't understand how OffscreenCanvas2D works [at all](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc;l=422;drc=23c1350a5eb632830a9ece307987fdd6816893f1;bpv=1;bpt=1) - am I missing something there?

Colin Blundell

Actually, pursuing this further, this CL is [*not*](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc;l=1465-1479?q=DrawingBuffer::Ad&ss=chromium) a no-op for WebGL, is it? We'll now draw to the screen in cases where we wouldn't before. It's not clear to me what happens for the pixels not covered by the drawing buffer? (This overlaps with my workstream for marking external writes as complete overwrites).

Vasiliy Telezhnikov

This CL doesn't change anything related to Dispatcher size or resource size, it just changes the damage rect that we pass to display compositor. So nothing in regard of this size check changes, or I misunderstood your question?

Yes, WebGL and ImageBitmap canvas right now don't present anything if size mismatches.

There is dispatcher size, which becomes render pass / compositor frame size. There is resource size, which becomes transferable resource size.

And there is damage rect, a hint that tells display compositor which portion of the render pass changed since the last frame. This was in a resource space, now it's in a render pass space as it supposed to be. Normally it wouldn't be no-op, but of that size check we do't submit frames in that case anyway.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Gerrit-Change-Number: 7681273
Gerrit-PatchSet: 3
Gerrit-Owner: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Mon, 23 Mar 2026 14:01:04 +0000
satisfied_requirement
open
diffy

Colin Blundell (Gerrit)

unread,
10:08 AM (9 hours ago) 10:08 AM
to Vasiliy Telezhnikov, Colin Blundell, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, kainin...@chromium.org
Attention needed from Vasiliy Telezhnikov

Colin Blundell added 1 comment

Commit Message
Line 19, Patchset 3 (Latest):check is incorrect and we should remove it.
Colin Blundell . resolved

This is a doozy. Am I understanding correctly that this means that WebGL won't actually draw to the screen for offscreen canvas in cases where the drawing buffer size is smaller than the canvas size?

I also don't understand how OffscreenCanvas2D works [at all](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.cc;l=422;drc=23c1350a5eb632830a9ece307987fdd6816893f1;bpv=1;bpt=1) - am I missing something there?

Colin Blundell

Actually, pursuing this further, this CL is [*not*](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc;l=1465-1479?q=DrawingBuffer::Ad&ss=chromium) a no-op for WebGL, is it? We'll now draw to the screen in cases where we wouldn't before. It's not clear to me what happens for the pixels not covered by the drawing buffer? (This overlaps with my workstream for marking external writes as complete overwrites).

Vasiliy Telezhnikov

This CL doesn't change anything related to Dispatcher size or resource size, it just changes the damage rect that we pass to display compositor. So nothing in regard of this size check changes, or I misunderstood your question?

Yes, WebGL and ImageBitmap canvas right now don't present anything if size mismatches.

There is dispatcher size, which becomes render pass / compositor frame size. There is resource size, which becomes transferable resource size.

And there is damage rect, a hint that tells display compositor which portion of the render pass changed since the last frame. This was in a resource space, now it's in a render pass space as it supposed to be. Normally it wouldn't be no-op, but of that size check we do't submit frames in that case anyway.

Colin Blundell

That makes sense, thanks! You understood my question correctly - I got the damage rect and the resource size conflated.

Open in Gerrit

Related details

Attention is currently required from:
  • Vasiliy Telezhnikov
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Gerrit-Change-Number: 7681273
Gerrit-PatchSet: 3
Gerrit-Owner: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Mon, 23 Mar 2026 14:08:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Colin Blundell <blun...@chromium.org>
Comment-In-Reply-To: Vasiliy Telezhnikov <vas...@chromium.org>
satisfied_requirement
open
diffy

Vasiliy Telezhnikov (Gerrit)

unread,
10:32 AM (9 hours ago) 10:32 AM
to Colin Blundell, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, kainin...@chromium.org

Vasiliy Telezhnikov voted and added 1 comment

Votes added by Vasiliy Telezhnikov

Commit-Queue+2

1 comment

Patchset-level comments
Vasiliy Telezhnikov . resolved

Thanks for the review.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Gerrit-Change-Number: 7681273
Gerrit-PatchSet: 3
Gerrit-Owner: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Comment-Date: Mon, 23 Mar 2026 14:32:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Chromium LUCI CQ (Gerrit)

unread,
12:48 PM (7 hours ago) 12:48 PM
to Vasiliy Telezhnikov, Colin Blundell, chromium...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, cwalle...@chromium.org, kainin...@chromium.org

Chromium LUCI CQ submitted the change

Change information

Commit message:
Fix OffscreenCanvas::PushFrame damage rect

All non-2d cases don't really track damage rect and want to damage whole
canvas every frame.

The damage rect is supposed to be in the render pass space, not the
texture space, so we need to use canvas size and not shared image size.

To simplify further refactoring, we make damage rect optional and make
full damage if it's nullopt.

Note, it's no-op because of the image size check here [1], but that

check is incorrect and we should remove it.

Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Commit-Queue: Vasiliy Telezhnikov <vas...@chromium.org>
Reviewed-by: Colin Blundell <blun...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1603552}
Files:
  • M third_party/blink/renderer/core/html/canvas/canvas_rendering_context_host.h
  • M third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
  • M third_party/blink/renderer/core/html/canvas/html_canvas_element.h
  • M third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc
  • M third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h
  • M third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context.cc
  • M third_party/blink/renderer/modules/canvas/offscreencanvas/offscreen_canvas_test.cc
  • M third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
  • M third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc
Change size: S
Delta: 9 files changed, 20 insertions(+), 24 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Colin Blundell
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ic5f6b0bfb7481fdfa0c2bbde1b3effc706fe033e
Gerrit-Change-Number: 7681273
Gerrit-PatchSet: 4
Gerrit-Owner: Vasiliy Telezhnikov <vas...@chromium.org>
Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
Gerrit-Reviewer: Colin Blundell <blun...@chromium.org>
Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages