[FPF-CI] Track triggers when canvas is transferred to offscreen [chromium/src : main]

0 views
Skip to first unread message

Tom Van Goethem (Gerrit)

unread,
Jun 19, 2025, 9:51:18 AM6/19/25
to Jean-Philippe Gravel, John Kim, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Jean-Philippe Gravel and John Kim

Tom Van Goethem added 1 comment

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Tom Van Goethem . resolved

This CL is mostly ready, except for the tests - which I can't quite seem to figure out. See details in comment.

Open in Gerrit

Related details

Attention is currently required from:
  • Jean-Philippe Gravel
  • John Kim
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
Gerrit-Change-Number: 6652692
Gerrit-PatchSet: 9
Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-Reviewer: John Kim <john...@google.com>
Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: John Kim <john...@google.com>
Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
Gerrit-Comment-Date: Thu, 19 Jun 2025 13:51:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Tom Van Goethem (Gerrit)

unread,
Jun 19, 2025, 9:56:56 AM6/19/25
to Jean-Philippe Gravel, John Kim, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Jean-Philippe Gravel and John Kim

Tom Van Goethem added 1 comment

File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
Line 174, Patchset 9 (Latest): // This is failing because the resource provider is a
// CanvasResourceProviderBitmap instead of a
// CanvasResourceProviderSharedImage. This is because the context is not
// accelerated.
Tom Van Goethem . unresolved

@jpgr...@chromium.org - I was wondering if you could possibly point me in the right direction here? I've been doing some debugging, and it seems that the resource provider of the offscreen canvas is a `CanvasResourceProviderBitmap`, whereas I was expecting it to have a `CanvasResourceProviderSharedImage`. I presume that this is because the canvas is not accelerated (I'm running tests on a device without a GPU). Is there some other way that I can still get the CanvasResource that is created by the offscreen canvas? Or should I change the way that I'm trying to test things?

Open in Gerrit

Related details

Attention is currently required from:
  • Jean-Philippe Gravel
  • John Kim
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
    Gerrit-Change-Number: 6652692
    Gerrit-PatchSet: 9
    Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
    Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Reviewer: John Kim <john...@google.com>
    Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: John Kim <john...@google.com>
    Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Comment-Date: Thu, 19 Jun 2025 13:56:45 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jean-Philippe Gravel (Gerrit)

    unread,
    Jun 19, 2025, 4:39:31 PM6/19/25
    to Tom Van Goethem, John Kim, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from John Kim and Tom Van Goethem

    Jean-Philippe Gravel added 1 comment

    File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
    Line 174, Patchset 9 (Latest): // This is failing because the resource provider is a
    // CanvasResourceProviderBitmap instead of a
    // CanvasResourceProviderSharedImage. This is because the context is not
    // accelerated.
    Tom Van Goethem . unresolved

    @jpgr...@chromium.org - I was wondering if you could possibly point me in the right direction here? I've been doing some debugging, and it seems that the resource provider of the offscreen canvas is a `CanvasResourceProviderBitmap`, whereas I was expecting it to have a `CanvasResourceProviderSharedImage`. I presume that this is because the canvas is not accelerated (I'm running tests on a device without a GPU). Is there some other way that I can still get the CanvasResource that is created by the offscreen canvas? Or should I change the way that I'm trying to test things?

    Jean-Philippe Gravel

    We have unit tests validating GPU accelerated code paths. [See how I enabled GPU acceleration in canvas_noise_test.cc](https://crrev.com/c/6438556) ;)

    What happens here is that a software resource provider was used because GPU compositing was disabled ([see here](https://crsrc.org/c/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc;l=646;drc=c06fea974510acde08228ce5a0dd6927436b4deb)).

    You'll need to add this at the beginning of the test:
    ```
    ScopedTestingPlatformSupport<GpuMemoryBufferTestPlatform> platform;
    scoped_refptr<viz::TestContextProvider> test_context_provider =
    viz::TestContextProvider::CreateRaster();
    InitializeSharedGpuContextRaster(test_context_provider.get());
    test_context_provider->GetTestRasterInterface()->set_gpu_rasterization(true);
    ```
    and this at the end:
    ```
    SharedGpuContext::Reset();
    ```
    Open in Gerrit

    Related details

    Attention is currently required from:
    • John Kim
    • Tom Van Goethem
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
    Gerrit-Change-Number: 6652692
    Gerrit-PatchSet: 9
    Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
    Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Reviewer: John Kim <john...@google.com>
    Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: John Kim <john...@google.com>
    Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
    Gerrit-Comment-Date: Thu, 19 Jun 2025 20:39:26 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Tom Van Goethem <t...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tom Van Goethem (Gerrit)

    unread,
    Jun 19, 2025, 6:58:38 PM6/19/25
    to Jean-Philippe Gravel, John Kim, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Jean-Philippe Gravel and John Kim

    Tom Van Goethem added 1 comment

    File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
    Line 174, Patchset 9: // This is failing because the resource provider is a

    // CanvasResourceProviderBitmap instead of a
    // CanvasResourceProviderSharedImage. This is because the context is not
    // accelerated.
    Tom Van Goethem . resolved

    @jpgr...@chromium.org - I was wondering if you could possibly point me in the right direction here? I've been doing some debugging, and it seems that the resource provider of the offscreen canvas is a `CanvasResourceProviderBitmap`, whereas I was expecting it to have a `CanvasResourceProviderSharedImage`. I presume that this is because the canvas is not accelerated (I'm running tests on a device without a GPU). Is there some other way that I can still get the CanvasResource that is created by the offscreen canvas? Or should I change the way that I'm trying to test things?

    Jean-Philippe Gravel

    We have unit tests validating GPU accelerated code paths. [See how I enabled GPU acceleration in canvas_noise_test.cc](https://crrev.com/c/6438556) ;)

    What happens here is that a software resource provider was used because GPU compositing was disabled ([see here](https://crsrc.org/c/third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.cc;l=646;drc=c06fea974510acde08228ce5a0dd6927436b4deb)).

    You'll need to add this at the beginning of the test:
    ```
    ScopedTestingPlatformSupport<GpuMemoryBufferTestPlatform> platform;
    scoped_refptr<viz::TestContextProvider> test_context_provider =
    viz::TestContextProvider::CreateRaster();
    InitializeSharedGpuContextRaster(test_context_provider.get());
    test_context_provider->GetTestRasterInterface()->set_gpu_rasterization(true);
    ```
    and this at the end:
    ```
    SharedGpuContext::Reset();
    ```
    Tom Van Goethem

    Ahhh, I should've remembered that :) That seems to have fixed the test. Thanks a lot!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jean-Philippe Gravel
    • John Kim
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
    Gerrit-Change-Number: 6652692
    Gerrit-PatchSet: 10
    Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
    Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Reviewer: John Kim <john...@google.com>
    Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: John Kim <john...@google.com>
    Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Comment-Date: Thu, 19 Jun 2025 22:58:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    John Kim (Gerrit)

    unread,
    Jun 24, 2025, 11:00:28 AM6/24/25
    to Tom Van Goethem, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Jean-Philippe Gravel and Tom Van Goethem

    John Kim voted and added 1 comment

    Votes added by John Kim

    Code-Review+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 10 (Latest):
    John Kim . resolved

    Sorry I missed this! LGTM

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Jean-Philippe Gravel
    • Tom Van Goethem
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
    Gerrit-Change-Number: 6652692
    Gerrit-PatchSet: 10
    Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
    Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Reviewer: John Kim <john...@google.com>
    Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
    Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
    Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
    Gerrit-Comment-Date: Tue, 24 Jun 2025 15:00:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Jean-Philippe Gravel (Gerrit)

    unread,
    Jun 26, 2025, 2:16:29 PM6/26/25
    to Tom Van Goethem, John Kim, Code Review Nudger, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Tom Van Goethem

    Jean-Philippe Gravel added 2 comments

    Commit Message
    Line 9, Patchset 10 (Latest):When a canvas is transferred to offscreen, we should keep track of the operations that are made on them such that we can determine whether the canvas should be noised.
    Jean-Philippe Gravel . unresolved

    I don't quite follow. When transferring to offscreen, the original canvas becomes a placeholder and all of the state tracking and rendering is handled by an `OffscreenCanvas` and an `OffscreenCanvasRenderingContext2D` object. That context knows it's own intervention triggers and the offscreen canvas can already noise it's output, without having to synchronize additional states.

    When reading back from the placeholder canvas, [the offscreen resource is read](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1345;drc=13075886efc851f658b6b14500272e62e5521614), and this happens [before the noise is applied](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1504,1508;drc=13075886efc851f658b6b14500272e62e5521614).

    It seems to me that noise should already be applied correctly. Or am I missing something?

    File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
    Line 1644, Patchset 10 (Latest): (Host() && Host()->HasTriggerForIntervention());
    Jean-Philippe Gravel . unresolved

    I don't think that this delegation via the host make sense, or is needed. There is only ever a single context for a given canvas.

    If a 2D HTMLCanvasElement is transferred to offscreen, the HTMLCanvasElement becomes a placeholder canvas and [it will never have an associated context of it's own](https://crsrc.org/c/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc;l=22-28;drc=13075886efc851f658b6b14500272e62e5521614).

    Thus, the only context at play will be an `OffscreenCanvasRenderingContext2D`, which knows it's own trigger intervention status. No need to query the host.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Tom Van Goethem
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
      Gerrit-Change-Number: 6652692
      Gerrit-PatchSet: 10
      Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
      Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
      Gerrit-Reviewer: John Kim <john...@google.com>
      Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
      Gerrit-Comment-Date: Thu, 26 Jun 2025 18:16:23 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Jean-Philippe Gravel (Gerrit)

      unread,
      Jun 26, 2025, 2:30:20 PM6/26/25
      to Tom Van Goethem, John Kim, Code Review Nudger, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Tom Van Goethem

      Jean-Philippe Gravel added 1 comment

      Commit Message
      Line 9, Patchset 10 (Latest):When a canvas is transferred to offscreen, we should keep track of the operations that are made on them such that we can determine whether the canvas should be noised.
      Jean-Philippe Gravel . unresolved

      I don't quite follow. When transferring to offscreen, the original canvas becomes a placeholder and all of the state tracking and rendering is handled by an `OffscreenCanvas` and an `OffscreenCanvasRenderingContext2D` object. That context knows it's own intervention triggers and the offscreen canvas can already noise it's output, without having to synchronize additional states.

      When reading back from the placeholder canvas, [the offscreen resource is read](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1345;drc=13075886efc851f658b6b14500272e62e5521614), and this happens [before the noise is applied](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1504,1508;drc=13075886efc851f658b6b14500272e62e5521614).

      It seems to me that noise should already be applied correctly. Or am I missing something?

      Jean-Philippe Gravel

      Ha, here's something I overlooked. [When reading back a placeholder canvas, `context_` will be nullptr](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1509;drc=13075886efc851f658b6b14500272e62e5521614) and thus, noise won't be applied. But this CL isn't addressing this issue.

      Gerrit-Comment-Date: Thu, 26 Jun 2025 18:30:12 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Tom Van Goethem (Gerrit)

      unread,
      Jul 14, 2025, 5:27:48 PM7/14/25
      to chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Jean-Philippe Gravel and John Kim

      Tom Van Goethem added 2 comments

      Commit Message
      Line 9, Patchset 10:When a canvas is transferred to offscreen, we should keep track of the operations that are made on them such that we can determine whether the canvas should be noised.
      Jean-Philippe Gravel . resolved

      I don't quite follow. When transferring to offscreen, the original canvas becomes a placeholder and all of the state tracking and rendering is handled by an `OffscreenCanvas` and an `OffscreenCanvasRenderingContext2D` object. That context knows it's own intervention triggers and the offscreen canvas can already noise it's output, without having to synchronize additional states.

      When reading back from the placeholder canvas, [the offscreen resource is read](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1345;drc=13075886efc851f658b6b14500272e62e5521614), and this happens [before the noise is applied](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1504,1508;drc=13075886efc851f658b6b14500272e62e5521614).

      It seems to me that noise should already be applied correctly. Or am I missing something?

      Jean-Philippe Gravel

      Ha, here's something I overlooked. [When reading back a placeholder canvas, `context_` will be nullptr](https://crsrc.org/c/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc;l=1509;drc=13075886efc851f658b6b14500272e62e5521614) and thus, noise won't be applied. But this CL isn't addressing this issue.

      Tom Van Goethem

      Yeah, you're right. The context indeed is aware which triggers happened. I've updated the code and commit message to mainly take into account `context_` being a nullptr when transferring to an offscreen canvas.

      File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
      Line 1644, Patchset 10: (Host() && Host()->HasTriggerForIntervention());
      Jean-Philippe Gravel . resolved

      I don't think that this delegation via the host make sense, or is needed. There is only ever a single context for a given canvas.

      If a 2D HTMLCanvasElement is transferred to offscreen, the HTMLCanvasElement becomes a placeholder canvas and [it will never have an associated context of it's own](https://crsrc.org/c/third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc;l=22-28;drc=13075886efc851f658b6b14500272e62e5521614).

      Thus, the only context at play will be an `OffscreenCanvasRenderingContext2D`, which knows it's own trigger intervention status. No need to query the host.

      Tom Van Goethem

      Updated. I've moved the checks to `BaseRenderingContext2D`, which I think makes more sense.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Jean-Philippe Gravel
      • John Kim
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
        Gerrit-Change-Number: 6652692
        Gerrit-PatchSet: 14
        Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
        Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-Reviewer: John Kim <john...@google.com>
        Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
        Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: John Kim <john...@google.com>
        Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
        Gerrit-Comment-Date: Mon, 14 Jul 2025 21:27:35 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Jean-Philippe Gravel (Gerrit)

        unread,
        Jul 15, 2025, 4:23:59 PM7/15/25
        to Tom Van Goethem, chromium...@chromium.org, John Kim, Code Review Nudger, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
        Attention needed from John Kim and Tom Van Goethem

        Jean-Philippe Gravel added 11 comments

        Patchset-level comments
        File-level comment, Patchset 14 (Latest):
        Jean-Philippe Gravel . unresolved

        I left comments based on the current state of the code, but I however have doubt around the use of the context to propagate the intervention flag.

        The placeholder never depended directly on the offscreen canvas. Adding a new dependency between the two could have implications around garbage collection and object destruction order. More importantly however, I think that using the context to propagate the flag opens the door to bugs.

        Consider the following:
        ```C++
        offscreen_canvas = canvas.transferControlToOffscreen();
        context = offscreen_canvas.getContext('2d');
        context.fillText(...); // Taints the context.

        // Wait for the frame to propagate to the placeholder.
        await new Promise(resolve => requestAnimationFrame(resolve));

        // Reset the context, this removes the taint.
        context.reset();

        // Read back the frame.
        // The context is no longer tainted, but the placeholder still holds
        // the frame with drawn text.
        url = canvas.toDataURL();
        ```

        I think that propagating the intervention flag via the `CanvasResource` (what the CL originally did) might be preferable. This is how the origin-clean flag is propagated. It does make sense for a canvas resource to carry the taint because that's what hold the image.

        File third_party/blink/renderer/core/html/canvas/html_canvas_element.h
        Line 545, Patchset 14 (Latest): Member<OffscreenCanvas> controlling_offscreen_canvas_;
        Jean-Philippe Gravel . unresolved

        Logically, this would belong to the `OffscreenCanvasPlaceholder` parent class. Move the attribute that the setter there?

        File third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
        Line 1388, Patchset 14 (Latest): if (HasOffscreenCanvasFrame()) {
        Jean-Philippe Gravel . unresolved

        It might be safer to check `controlling_offscreen_canvas_` instead of `HasOffscreenCanvasFrame()`? Both should be equivalent, but checking the pointer offers stronger guaranties that it's valid before we use it.

        Line 1389, Patchset 14 (Latest): context = controlling_offscreen_canvas_->RenderingContext();
        Jean-Philippe Gravel . unresolved

        If we move `controlling_offscreen_canvas_` to the parent class (as suggested in other comment), perhaps a adding a getter for `controlling_offscreen_canvas_` or `controlling_offscreen_canvas_ ? controlling_offscreen_canvas_->RenderingContext() : nullptr` in `OffscreenCanvasPlaceholder ` might be useful to centralize and isolate accesses to `controlling_offscreen_canvas_`.

        File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
        Line 1652, Patchset 14 (Latest): return triggers_for_intervention_;
        Jean-Philippe Gravel . unresolved

        Why not keep using `GetTriggersForIntervention()`, like `CanvasRenderingContext2D::GetCanvasTriggerOperations` originally did, and similarly to how `ShouldTriggerIntervention()` above isn't reading `triggers_for_intervention_` directly either? Reading this attribute directly pulls a member from the parent class, breaking encapsulation.

        File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc
        Line 62, Patchset 14 (Latest): canvas.SetControllingOffscreenCanvas(offscreen_canvas);
        Jean-Philippe Gravel . unresolved

        I think that this should be moved into `TransferControlToOffscreenInternal`, essentially next to (or leveraging?) `canvas.RegisterPlaceholderCanvas()`. If another call was ever added to `TransferControlToOffscreenInternal`, we wouldn't what the transfer to exclude this new code.

        File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
        Line 169, Patchset 14 (Latest): OffscreenCanvas* offscreen_canvas =
        Jean-Philippe Gravel . unresolved

        The lack of line break makes it hard to see the different parts of the tests. Good tests should be structured with a setup, act and expectation section. Maybe add a line break here and another before the first call to `SetCanvasInterventionsForceDisabled` to make these sections stand out better?

        Line 179, Patchset 14 (Latest): auto* script_state = ToScriptStateForMainWorld(GetDocument().GetFrame());
        Jean-Philippe Gravel . unresolved

        Maybe just write `ScriptState*` explicitly? From the style guide:
        “Do not use [auto] merely to avoid the inconvenience of writing an explicit type.”
        https://google.github.io/styleguide/cppguide.html#Type_deduction

        Line 179, Patchset 14 (Latest): auto* script_state = ToScriptStateForMainWorld(GetDocument().GetFrame());
        context->setFillStyle(script_state->GetIsolate(),
        ToV8Traits<IDLString>::ToV8(script_state, "red"),
        exception_state);
        context->fillRect(0, 0, 50, 50);
        Jean-Philippe Gravel . unresolved

        What's this for? Wasn't the `fillText` sufficient to trigger the behavior we want?

        Line 184, Patchset 14 (Latest): context->PushFrame();
        CanvasResourceProvider* provider = context->GetResourceProviderForCanvas2D();
        scoped_refptr<CanvasResource> canvas_resource =
        provider->ProduceCanvasResource(FlushReason::kTesting);
        viz::ResourceIdGenerator id_generator;
        canvas_element().SetOffscreenCanvasResource(std::move(canvas_resource),
        id_generator.GenerateNextId());
        Jean-Philippe Gravel . unresolved

        This looks like a leftover from an earlier version of the CL. It shouldn't be needed now that the placeholder canvas directly accesses the offscreen context.

        File third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.h
        Line 11, Patchset 14 (Latest):#include "third_party/blink/renderer/core/canvas_interventions/canvas_interventions_enums.h"
        Jean-Philippe Gravel . unresolved

        Remove?

        Open in Gerrit

        Related details

        Attention is currently required from:
        • John Kim
        • Tom Van Goethem
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
          Gerrit-Change-Number: 6652692
          Gerrit-PatchSet: 14
          Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: John Kim <john...@google.com>
          Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: John Kim <john...@google.com>
          Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
          Gerrit-Comment-Date: Tue, 15 Jul 2025 20:23:50 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Tom Van Goethem (Gerrit)

          unread,
          Jul 16, 2025, 8:45:07 AM7/16/25
          to chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from Jean-Philippe Gravel and John Kim

          Tom Van Goethem added 11 comments

          Patchset-level comments
          Jean-Philippe Gravel . unresolved

          I left comments based on the current state of the code, but I however have doubt around the use of the context to propagate the intervention flag.

          The placeholder never depended directly on the offscreen canvas. Adding a new dependency between the two could have implications around garbage collection and object destruction order. More importantly however, I think that using the context to propagate the flag opens the door to bugs.

          Consider the following:
          ```C++
          offscreen_canvas = canvas.transferControlToOffscreen();
          context = offscreen_canvas.getContext('2d');
          context.fillText(...); // Taints the context.

          // Wait for the frame to propagate to the placeholder.
          await new Promise(resolve => requestAnimationFrame(resolve));

          // Reset the context, this removes the taint.
          context.reset();

          // Read back the frame.
          // The context is no longer tainted, but the placeholder still holds
          // the frame with drawn text.
          url = canvas.toDataURL();
          ```

          I think that propagating the intervention flag via the `CanvasResource` (what the CL originally did) might be preferable. This is how the origin-clean flag is propagated. It does make sense for a canvas resource to carry the taint because that's what hold the image.

          Tom Van Goethem

          For now I've kept the reference to OffscreenCanvas in HTMLCanvasElement, but also added the taint to CanvasResource and StaticBitmapImage (which will be needed anyway for tainting `drawImage()`). I added an additional check for this in `ShouldApplyNoise`.

          I'm considering redesigning some parts of `CanvasInterventionsHelper::MaybeNoiseSnapshot` though; I believe it should be sufficient to check whether there are any triggers (and only create the triggers when these are made in an accelerated context). In that case, no rendering context would be needed. Would it be fine to do that in a follow-up CL?

          File third_party/blink/renderer/core/html/canvas/html_canvas_element.h
          Line 545, Patchset 14: Member<OffscreenCanvas> controlling_offscreen_canvas_;
          Jean-Philippe Gravel . unresolved

          Logically, this would belong to the `OffscreenCanvasPlaceholder` parent class. Move the attribute that the setter there?

          Tom Van Goethem

          That's a bit tricky. The `OffscreenCanvasPlaceholder` parent class is in `platform/` whereas `OffscreenCanvas` is in `core/` so the former can't depend on the latter. It's also not possible to forward declare `OffscreenCanvas` as that doesn't work with `Trace()`.

          I've kept `controlling_offscreen_canvas_` in `HTMLCanvasElement` for now - please let me know if I should find a workaround.

          File third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
          Line 1388, Patchset 14: if (HasOffscreenCanvasFrame()) {
          Jean-Philippe Gravel . resolved

          It might be safer to check `controlling_offscreen_canvas_` instead of `HasOffscreenCanvasFrame()`? Both should be equivalent, but checking the pointer offers stronger guaranties that it's valid before we use it.

          Tom Van Goethem

          Done

          Line 1389, Patchset 14: context = controlling_offscreen_canvas_->RenderingContext();
          Jean-Philippe Gravel . resolved

          If we move `controlling_offscreen_canvas_` to the parent class (as suggested in other comment), perhaps a adding a getter for `controlling_offscreen_canvas_` or `controlling_offscreen_canvas_ ? controlling_offscreen_canvas_->RenderingContext() : nullptr` in `OffscreenCanvasPlaceholder ` might be useful to centralize and isolate accesses to `controlling_offscreen_canvas_`.

          Tom Van Goethem

          Done

          File third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_context_2d.cc
          Line 1652, Patchset 14: return triggers_for_intervention_;
          Jean-Philippe Gravel . resolved

          Why not keep using `GetTriggersForIntervention()`, like `CanvasRenderingContext2D::GetCanvasTriggerOperations` originally did, and similarly to how `ShouldTriggerIntervention()` above isn't reading `triggers_for_intervention_` directly either? Reading this attribute directly pulls a member from the parent class, breaking encapsulation.

          Tom Van Goethem

          Done

          File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module.cc
          Line 62, Patchset 14: canvas.SetControllingOffscreenCanvas(offscreen_canvas);
          Jean-Philippe Gravel . resolved

          I think that this should be moved into `TransferControlToOffscreenInternal`, essentially next to (or leveraging?) `canvas.RegisterPlaceholderCanvas()`. If another call was ever added to `TransferControlToOffscreenInternal`, we wouldn't what the transfer to exclude this new code.

          Tom Van Goethem

          I've moved it into `RegisterPlaceholderCanvas` (and setting back to nullptr in `UnregisterPlaceholderCanvas`).

          File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
          Line 169, Patchset 14: OffscreenCanvas* offscreen_canvas =
          Jean-Philippe Gravel . resolved

          The lack of line break makes it hard to see the different parts of the tests. Good tests should be structured with a setup, act and expectation section. Maybe add a line break here and another before the first call to `SetCanvasInterventionsForceDisabled` to make these sections stand out better?

          Tom Van Goethem

          Done

          Line 179, Patchset 14: auto* script_state = ToScriptStateForMainWorld(GetDocument().GetFrame());
          Jean-Philippe Gravel . resolved

          Maybe just write `ScriptState*` explicitly? From the style guide:
          “Do not use [auto] merely to avoid the inconvenience of writing an explicit type.”
          https://google.github.io/styleguide/cppguide.html#Type_deduction

          Tom Van Goethem

          script_state was not needed any more.

          Line 179, Patchset 14: auto* script_state = ToScriptStateForMainWorld(GetDocument().GetFrame());

          context->setFillStyle(script_state->GetIsolate(),
          ToV8Traits<IDLString>::ToV8(script_state, "red"),
          exception_state);
          context->fillRect(0, 0, 50, 50);
          Jean-Philippe Gravel . resolved

          What's this for? Wasn't the `fillText` sufficient to trigger the behavior we want?

          Tom Van Goethem

          I added it while debugging things but forgot to remove it. Done.

          Line 184, Patchset 14: context->PushFrame();

          CanvasResourceProvider* provider = context->GetResourceProviderForCanvas2D();
          scoped_refptr<CanvasResource> canvas_resource =
          provider->ProduceCanvasResource(FlushReason::kTesting);
          viz::ResourceIdGenerator id_generator;
          canvas_element().SetOffscreenCanvasResource(std::move(canvas_resource),
          id_generator.GenerateNextId());
          Jean-Philippe Gravel . resolved

          This looks like a leftover from an earlier version of the CL. It shouldn't be needed now that the placeholder canvas directly accesses the offscreen context.

          Tom Van Goethem

          It is needed to get the CanvasResource to the HTMLCanvasElement; without this part the result of `toDataURL()` is a blank image.

          File third_party/blink/renderer/modules/canvas/offscreencanvas2d/offscreen_canvas_rendering_context_2d.h
          Line 11, Patchset 14:#include "third_party/blink/renderer/core/canvas_interventions/canvas_interventions_enums.h"
          Jean-Philippe Gravel . resolved

          Remove?

          Tom Van Goethem

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jean-Philippe Gravel
          • John Kim
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
          Gerrit-Change-Number: 6652692
          Gerrit-PatchSet: 14
          Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: John Kim <john...@google.com>
          Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: John Kim <john...@google.com>
          Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Comment-Date: Wed, 16 Jul 2025 12:44:54 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Jean-Philippe Gravel (Gerrit)

          unread,
          Jul 16, 2025, 1:21:00 PM7/16/25
          to Tom Van Goethem, chromium...@chromium.org, John Kim, Code Review Nudger, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from John Kim and Tom Van Goethem

          Jean-Philippe Gravel added 2 comments

          Patchset-level comments
          Jean-Philippe Gravel . unresolved

          I left comments based on the current state of the code, but I however have doubt around the use of the context to propagate the intervention flag.

          The placeholder never depended directly on the offscreen canvas. Adding a new dependency between the two could have implications around garbage collection and object destruction order. More importantly however, I think that using the context to propagate the flag opens the door to bugs.

          Consider the following:
          ```C++
          offscreen_canvas = canvas.transferControlToOffscreen();
          context = offscreen_canvas.getContext('2d');
          context.fillText(...); // Taints the context.

          // Wait for the frame to propagate to the placeholder.
          await new Promise(resolve => requestAnimationFrame(resolve));

          // Reset the context, this removes the taint.
          context.reset();

          // Read back the frame.
          // The context is no longer tainted, but the placeholder still holds
          // the frame with drawn text.
          url = canvas.toDataURL();
          ```

          I think that propagating the intervention flag via the `CanvasResource` (what the CL originally did) might be preferable. This is how the origin-clean flag is propagated. It does make sense for a canvas resource to carry the taint because that's what hold the image.

          Tom Van Goethem

          For now I've kept the reference to OffscreenCanvas in HTMLCanvasElement, but also added the taint to CanvasResource and StaticBitmapImage (which will be needed anyway for tainting `drawImage()`). I added an additional check for this in `ShouldApplyNoise`.

          I'm considering redesigning some parts of `CanvasInterventionsHelper::MaybeNoiseSnapshot` though; I believe it should be sufficient to check whether there are any triggers (and only create the triggers when these are made in an accelerated context). In that case, no rendering context would be needed. Would it be fine to do that in a follow-up CL?

          Jean-Philippe Gravel

          added the taint to CanvasResource and StaticBitmapImage (which will be needed anyway for tainting drawImage()). I added an additional check for this in ShouldApplyNoise.

          That works!

          For now I've kept the reference to OffscreenCanvas in HTMLCanvasElement

          Why keep this code? It seems redundant to the taint in the CanvasResource, but has lower precision. Consider the flip side of the above example:

          ```c++


          offscreen_canvas = canvas.transferControlToOffscreen();
          context = offscreen_canvas.getContext('2d');

          context.fillRect(...); // Doesn't taint the context.

          // Wait for the frame to propagate to the placeholder.
          await new Promise(resolve => requestAnimationFrame(resolve));

          context.fillText(...); // Taints the context.

          // Read back the frame.
          // The frame doesn't yet contain the text and doesn't need to be noised.
          // The context however is tainted so the frame is incorrectly noised.
          url = canvas.toDataURL();
          ```

          File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
          Line 180, Patchset 16 (Latest): context->PushFrame();

          CanvasResourceProvider* provider = context->GetResourceProviderForCanvas2D();
          scoped_refptr<CanvasResource> canvas_resource =
          provider->ProduceCanvasResource(FlushReason::kTesting);
          viz::ResourceIdGenerator id_generator;
          canvas_element().SetOffscreenCanvasResource(std::move(canvas_resource),
          id_generator.GenerateNextId());
          Jean-Philippe Gravel . unresolved

          This is re-implementing a lot of logic from the `OffscreenCanvas` implementation which should already be taken care of. It looks You could replace all of this with:
          ```c++
          platform->RunUntilIdle();
          ```

          Open in Gerrit

          Related details

          Attention is currently required from:
          • John Kim
          • Tom Van Goethem
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
          Gerrit-Change-Number: 6652692
          Gerrit-PatchSet: 16
          Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: John Kim <john...@google.com>
          Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: John Kim <john...@google.com>
          Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
          Gerrit-Comment-Date: Wed, 16 Jul 2025 17:20:51 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Jean-Philippe Gravel (Gerrit)

          unread,
          Jul 16, 2025, 1:31:51 PM7/16/25
          to Tom Van Goethem, chromium...@chromium.org, John Kim, Code Review Nudger, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from John Kim and Tom Van Goethem

          Jean-Philippe Gravel added 1 comment

          File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
          Line 180, Patchset 16 (Latest): context->PushFrame();
          CanvasResourceProvider* provider = context->GetResourceProviderForCanvas2D();
          scoped_refptr<CanvasResource> canvas_resource =
          provider->ProduceCanvasResource(FlushReason::kTesting);
          viz::ResourceIdGenerator id_generator;
          canvas_element().SetOffscreenCanvasResource(std::move(canvas_resource),
          id_generator.GenerateNextId());
          Jean-Philippe Gravel . unresolved

          This is re-implementing a lot of logic from the `OffscreenCanvas` implementation which should already be taken care of. It looks You could replace all of this with:
          ```c++
          platform->RunUntilIdle();
          ```

          Jean-Philippe Gravel

          Hum. Or maybe not. After further verification, that might not be quite right. Let me investigate some more.

          Gerrit-Comment-Date: Wed, 16 Jul 2025 17:31:41 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Tom Van Goethem (Gerrit)

          unread,
          Jul 17, 2025, 1:07:53 PM7/17/25
          to chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from Jean-Philippe Gravel and John Kim

          Tom Van Goethem added 1 comment

          File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
          Line 180, Patchset 16: context->PushFrame();

          CanvasResourceProvider* provider = context->GetResourceProviderForCanvas2D();
          scoped_refptr<CanvasResource> canvas_resource =
          provider->ProduceCanvasResource(FlushReason::kTesting);
          viz::ResourceIdGenerator id_generator;
          canvas_element().SetOffscreenCanvasResource(std::move(canvas_resource),
          id_generator.GenerateNextId());
          Jean-Philippe Gravel . unresolved

          This is re-implementing a lot of logic from the `OffscreenCanvas` implementation which should already be taken care of. It looks You could replace all of this with:
          ```c++
          platform->RunUntilIdle();
          ```

          Jean-Philippe Gravel

          Hum. Or maybe not. After further verification, that might not be quite right. Let me investigate some more.

          Jean-Philippe Gravel

          Ok, I think I figured it out. These classes don't have very clean public API interfaces and boundaries, so figuring out how to properly write test without poking in the internals is tricky. But I think that the following does the trick:

          ```c++
          offscreen_canvas->GetOrCreateResourceDispatcher()->OnBeginFrame(
          /*begin_frame_args=*/{}, /*timing details*/ {},
          /*resources=*/{});
          test::RunPendingTasks();
          ```
          But the CL has many other issues:
          - The test was drawing the text to position (0, 0), which draws outside the canvas. Thus, no frame could get generated (rendering gets optimized out).
          - ShouldApplyNoise needs to be changed to work properly if no context is available (it should use the image snapshot instead).
          - Your change in `CanvasResourceSharedImage::Bitmap` was in a `if (!is_accelerated_)` block. You need to also propagate the taint for accelerated images.

          See my experiments here:
          https://crrev.com/c/6760097

          (I'm sorry, I forgot to clear the `Change-Id:` in the diffbase of my CL, which means that I accidentally pushed a rebase update on your CL.)

          Tom Van Goethem

          I've done some refactoring already and rebased on top of that. I still need to do some clean up next. I'll let you know when it's ready 👍

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jean-Philippe Gravel
          • John Kim
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
          Gerrit-Change-Number: 6652692
          Gerrit-PatchSet: 19
          Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: John Kim <john...@google.com>
          Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: John Kim <john...@google.com>
          Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Comment-Date: Thu, 17 Jul 2025 17:07:38 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          John Kim (Gerrit)

          unread,
          Jul 22, 2025, 3:02:18 PM7/22/25
          to Tom Van Goethem, chromium...@chromium.org, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from Jean-Philippe Gravel and Tom Van Goethem

          John Kim added 3 comments

          File third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
          Line 1383, Patchset 20 (Latest): canvas_operations |= image_bitmap->GetCanvasTriggerOperations();
          John Kim . unresolved

          What if ```image_bitmap->GetCanvasTriggerOperations() == CanvasOperationType::kNone```? This would add kNone to the total operations bitmask. Would this tamper with our metrics? Same with below.

          Line 1509, Patchset 20 (Latest): auto canvas_operations = CanvasOperationType::kNone;
          John Kim . unresolved

          nit: CanvasOperationType, for consistency with above.

          File third_party/blink/renderer/platform/graphics/static_bitmap_image.h
          Line 146, Patchset 20 (Latest): CanvasOperationType triggering_canvas_operations_ =
          John Kim . unresolved

          Could we add a docstring for this?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jean-Philippe Gravel
          • Tom Van Goethem
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
          Gerrit-Change-Number: 6652692
          Gerrit-PatchSet: 20
          Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: John Kim <john...@google.com>
          Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
          Gerrit-Comment-Date: Tue, 22 Jul 2025 19:02:12 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          AI Code Reviewer (Gerrit)

          unread,
          Aug 19, 2025, 11:39:40 AM8/19/25
          to Tom Van Goethem, chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from Tom Van Goethem

          AI Code Reviewer added 1 comment

          File third_party/blink/renderer/platform/graphics/canvas_resource.h
          Line 124, Patchset 22 (Latest): CanvasOperationType GetTriggersForIntervention() const {
          AI Code Reviewer . unresolved

          nit: Per the Blink Style Guide: Naming - Precede setters with the word “Set”; use bare words for getters, this getter should be named `TriggersForIntervention()` since the name does not conflict with a type name and does not use out-arguments.
          ***

          _To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options: \
          **Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason \
          \
          This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent). \
          AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve. \
          [File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Tom Van Goethem
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
          Gerrit-Change-Number: 6652692
          Gerrit-PatchSet: 22
          Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: John Kim <john...@google.com>
          Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
          Gerrit-Comment-Date: Tue, 19 Aug 2025 15:39:36 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Tom Van Goethem (Gerrit)

          unread,
          Aug 20, 2025, 8:47:12 AM8/20/25
          to Vasiliy Telezhnikov, Mike West, AI Code Reviewer, chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from Jean-Philippe Gravel, John Kim, Mike West and Vasiliy Telezhnikov

          Tom Van Goethem added 8 comments

          Patchset-level comments
          File-level comment, Patchset 14:
          Jean-Philippe Gravel . resolved
          Tom Van Goethem

          After the refactoring, we're no longer keeping a reference to OffscreenCanvas.

          Tom Van Goethem . resolved

          Hey @vas...@chromium.org, could you please review this CL as JP is OOO this week?

          For context: this CL aims to keep track of whether a canvas readback should be noised when the canvas is transferred to offscreen. Specifically, it will keep track of the executed high entropy canvas operations in the canvas resource.

          @mk...@chromium.org, could you review audit_non_blink_usage.py?

          Thanks!

          File third_party/blink/renderer/core/html/canvas/html_canvas_element.h
          Line 545, Patchset 14: Member<OffscreenCanvas> controlling_offscreen_canvas_;
          Jean-Philippe Gravel . resolved

          Logically, this would belong to the `OffscreenCanvasPlaceholder` parent class. Move the attribute that the setter there?

          Tom Van Goethem

          That's a bit tricky. The `OffscreenCanvasPlaceholder` parent class is in `platform/` whereas `OffscreenCanvas` is in `core/` so the former can't depend on the latter. It's also not possible to forward declare `OffscreenCanvas` as that doesn't work with `Trace()`.

          I've kept `controlling_offscreen_canvas_` in `HTMLCanvasElement` for now - please let me know if I should find a workaround.

          Tom Van Goethem

          No longer relevant.

          File third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
          Line 1383, Patchset 20: canvas_operations |= image_bitmap->GetCanvasTriggerOperations();
          John Kim . resolved

          What if ```image_bitmap->GetCanvasTriggerOperations() == CanvasOperationType::kNone```? This would add kNone to the total operations bitmask. Would this tamper with our metrics? Same with below.

          Tom Van Goethem

          kNone is `0` so adding it doesn't change anything.

          Line 1509, Patchset 20: auto canvas_operations = CanvasOperationType::kNone;
          John Kim . resolved

          nit: CanvasOperationType, for consistency with above.

          Tom Van Goethem

          Removed code.

          File third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
          Line 180, Patchset 16: context->PushFrame();
          CanvasResourceProvider* provider = context->GetResourceProviderForCanvas2D();
          scoped_refptr<CanvasResource> canvas_resource =
          provider->ProduceCanvasResource(FlushReason::kTesting);
          viz::ResourceIdGenerator id_generator;
          canvas_element().SetOffscreenCanvasResource(std::move(canvas_resource),
          id_generator.GenerateNextId());
          Jean-Philippe Gravel . resolved

          This is re-implementing a lot of logic from the `OffscreenCanvas` implementation which should already be taken care of. It looks You could replace all of this with:
          ```c++
          platform->RunUntilIdle();
          ```

          Jean-Philippe Gravel

          Hum. Or maybe not. After further verification, that might not be quite right. Let me investigate some more.

          Jean-Philippe Gravel

          Ok, I think I figured it out. These classes don't have very clean public API interfaces and boundaries, so figuring out how to properly write test without poking in the internals is tricky. But I think that the following does the trick:

          ```c++
          offscreen_canvas->GetOrCreateResourceDispatcher()->OnBeginFrame(
          /*begin_frame_args=*/{}, /*timing details*/ {},
          /*resources=*/{});
          test::RunPendingTasks();
          ```
          But the CL has many other issues:
          - The test was drawing the text to position (0, 0), which draws outside the canvas. Thus, no frame could get generated (rendering gets optimized out).
          - ShouldApplyNoise needs to be changed to work properly if no context is available (it should use the image snapshot instead).
          - Your change in `CanvasResourceSharedImage::Bitmap` was in a `if (!is_accelerated_)` block. You need to also propagate the taint for accelerated images.

          See my experiments here:
          https://crrev.com/c/6760097

          (I'm sorry, I forgot to clear the `Change-Id:` in the diffbase of my CL, which means that I accidentally pushed a rebase update on your CL.)

          Tom Van Goethem

          I've done some refactoring already and rebased on top of that. I still need to do some clean up next. I'll let you know when it's ready 👍

          Tom Van Goethem

          Refactoring was done in the parent CL (crrev.com/c/6765542), and the 3 points mentioned above have been addressed.

          File third_party/blink/renderer/platform/graphics/canvas_resource.h
          Line 124, Patchset 22: CanvasOperationType GetTriggersForIntervention() const {
          AI Code Reviewer . resolved

          nit: Per the Blink Style Guide: Naming - Precede setters with the word “Set”; use bare words for getters, this getter should be named `TriggersForIntervention()` since the name does not conflict with a type name and does not use out-arguments.
          ***

          _To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options: \
          **Done** | **Won't fix**: reason | **b/<bug_id>** | **Invalid:** reason \
          \
          This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent). \
          AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve. \
          [File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_
          Tom Van Goethem

          Done

          File third_party/blink/renderer/platform/graphics/static_bitmap_image.h
          Line 146, Patchset 20: CanvasOperationType triggering_canvas_operations_ =
          John Kim . resolved

          Could we add a docstring for this?

          Tom Van Goethem

          Removed code.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jean-Philippe Gravel
          • John Kim
          • Mike West
          • Vasiliy Telezhnikov
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
          Gerrit-Change-Number: 6652692
          Gerrit-PatchSet: 23
          Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Reviewer: John Kim <john...@google.com>
          Gerrit-Reviewer: Mike West <mk...@chromium.org>
          Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
          Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
          Gerrit-Attention: John Kim <john...@google.com>
          Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
          Gerrit-Attention: Mike West <mk...@chromium.org>
          Gerrit-Comment-Date: Wed, 20 Aug 2025 12:46:50 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: John Kim <john...@google.com>
          Comment-In-Reply-To: Jean-Philippe Gravel <jpgr...@chromium.org>
          Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Mike West (Gerrit)

          unread,
          Aug 20, 2025, 11:51:42 AM8/20/25
          to Tom Van Goethem, Vasiliy Telezhnikov, AI Code Reviewer, chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
          Attention needed from Jean-Philippe Gravel, John Kim, Tom Van Goethem and Vasiliy Telezhnikov

          Mike West added 1 comment

          File third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
          Line 2685, Patchset 23 (Latest): 'third_party/blink/renderer/modules/canvas/',
          Mike West . unresolved

          Nit: Please shift this to the specific paths. Especially given that it's a test-only interface, there's no reason to allow it throughout //modules/canvas.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Jean-Philippe Gravel
          • John Kim
          • Tom Van Goethem
          • Vasiliy Telezhnikov
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
            Gerrit-Change-Number: 6652692
            Gerrit-PatchSet: 23
            Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
            Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
            Gerrit-Reviewer: John Kim <john...@google.com>
            Gerrit-Reviewer: Mike West <mk...@chromium.org>
            Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
            Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
            Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
            Gerrit-CC: Stephen Chenney <sche...@chromium.org>
            Gerrit-Attention: Vasiliy Telezhnikov <vas...@chromium.org>
            Gerrit-Attention: John Kim <john...@google.com>
            Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
            Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
            Gerrit-Comment-Date: Wed, 20 Aug 2025 15:51:28 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Vasiliy Telezhnikov (Gerrit)

            unread,
            Aug 20, 2025, 2:03:17 PM8/20/25
            to Tom Van Goethem, Mike West, AI Code Reviewer, chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
            Attention needed from Jean-Philippe Gravel, John Kim and Tom Van Goethem

            Vasiliy Telezhnikov voted and added 1 comment

            Votes added by Vasiliy Telezhnikov

            Code-Review+1

            1 comment

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

            lgtm, thanks.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Jean-Philippe Gravel
            • John Kim
            • Tom Van Goethem
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
              Gerrit-Change-Number: 6652692
              Gerrit-PatchSet: 23
              Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
              Gerrit-Reviewer: John Kim <john...@google.com>
              Gerrit-Reviewer: Mike West <mk...@chromium.org>
              Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
              Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
              Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
              Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
              Gerrit-CC: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: John Kim <john...@google.com>
              Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
              Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
              Gerrit-Comment-Date: Wed, 20 Aug 2025 18:03:11 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Tom Van Goethem (Gerrit)

              unread,
              Aug 25, 2025, 9:57:02 AM8/25/25
              to Vasiliy Telezhnikov, Mike West, AI Code Reviewer, chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
              Attention needed from Jean-Philippe Gravel, John Kim and Mike West

              Tom Van Goethem voted and added 1 comment

              Votes added by Tom Van Goethem

              Auto-Submit+1
              Commit-Queue+1

              1 comment

              File third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
              Line 2685, Patchset 23: 'third_party/blink/renderer/modules/canvas/',
              Mike West . resolved

              Nit: Please shift this to the specific paths. Especially given that it's a test-only interface, there's no reason to allow it throughout //modules/canvas.

              Tom Van Goethem

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Jean-Philippe Gravel
              • John Kim
              • Mike West
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
              Gerrit-Change-Number: 6652692
              Gerrit-PatchSet: 24
              Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
              Gerrit-Reviewer: John Kim <john...@google.com>
              Gerrit-Reviewer: Mike West <mk...@chromium.org>
              Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
              Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
              Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
              Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
              Gerrit-CC: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: John Kim <john...@google.com>
              Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
              Gerrit-Attention: Mike West <mk...@chromium.org>
              Gerrit-Comment-Date: Mon, 25 Aug 2025 13:56:47 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              Comment-In-Reply-To: Mike West <mk...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Mike West (Gerrit)

              unread,
              Aug 25, 2025, 11:09:14 AM8/25/25
              to Tom Van Goethem, Vasiliy Telezhnikov, AI Code Reviewer, chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, Chromium LUCI CQ, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
              Attention needed from Jean-Philippe Gravel, John Kim and Tom Van Goethem

              Mike West voted and added 1 comment

              Votes added by Mike West

              Code-Review+1
              Commit-Queue+2

              1 comment

              File third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
              Line 2690, Patchset 24 (Latest): ]
              Mike West . resolved

              LGTM, thanks.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Jean-Philippe Gravel
              • John Kim
              • Tom Van Goethem
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement satisfiedCode-Owners
              • requirement satisfiedCode-Review
              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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
              Gerrit-Change-Number: 6652692
              Gerrit-PatchSet: 24
              Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
              Gerrit-Reviewer: John Kim <john...@google.com>
              Gerrit-Reviewer: Mike West <mk...@chromium.org>
              Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
              Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
              Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
              Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
              Gerrit-CC: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: John Kim <john...@google.com>
              Gerrit-Attention: Jean-Philippe Gravel <jpgr...@chromium.org>
              Gerrit-Attention: Tom Van Goethem <t...@chromium.org>
              Gerrit-Comment-Date: Mon, 25 Aug 2025 15:08:56 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              satisfied_requirement
              open
              diffy

              Chromium LUCI CQ (Gerrit)

              unread,
              Aug 25, 2025, 11:12:24 AM8/25/25
              to Tom Van Goethem, Mike West, Vasiliy Telezhnikov, AI Code Reviewer, chromium...@chromium.org, John Kim, Code Review Nudger, Jean-Philippe Gravel, Dirk Schulze, Stephen Chenney, AyeAye, drott+bl...@chromium.org, fmalit...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, fserb...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

              Chromium LUCI CQ submitted the change

              Change information

              Commit message:
              [FPF-CI] Track triggers when canvas is transferred to offscreen

              When a canvas is transferred to offscreen, we should ensure that noise
              is still applied. To that end, the correct rendering context needs to be
              passed when reading back as a blob or with toDataURL.
              Bug: 377325952
              Change-Id: I3a4060ef1bffe6be7538349b5f972a371bc051bb
              Auto-Submit: Tom Van Goethem <t...@chromium.org>
              Commit-Queue: Mike West <mk...@chromium.org>
              Reviewed-by: Mike West <mk...@chromium.org>
              Reviewed-by: Vasiliy Telezhnikov <vas...@chromium.org>
              Cr-Commit-Position: refs/heads/main@{#1505871}
              Files:
              • M third_party/blink/renderer/modules/BUILD.gn
              • M third_party/blink/renderer/modules/canvas/DEPS
              • M third_party/blink/renderer/modules/canvas/canvas_noise_test.cc
              • A third_party/blink/renderer/modules/canvas/canvas_noise_test_util.cc
              • A third_party/blink/renderer/modules/canvas/canvas_noise_test_util.h
              • M third_party/blink/renderer/modules/canvas/htmlcanvas/html_canvas_element_module_test.cc
              • M third_party/blink/renderer/platform/graphics/canvas_resource.cc
              • M third_party/blink/renderer/platform/graphics/canvas_resource.h
              • M third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
              • M third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
              Change size: M
              Delta: 10 files changed, 193 insertions(+), 33 deletions(-)
              Branch: refs/heads/main
              Submit Requirements:
              • requirement satisfiedCode-Review: +1 by Mike West, +1 by Vasiliy Telezhnikov
              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: I3a4060ef1bffe6be7538349b5f972a371bc051bb
              Gerrit-Change-Number: 6652692
              Gerrit-PatchSet: 25
              Gerrit-Owner: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
              Gerrit-Reviewer: Jean-Philippe Gravel <jpgr...@chromium.org>
              Gerrit-Reviewer: John Kim <john...@google.com>
              Gerrit-Reviewer: Mike West <mk...@chromium.org>
              Gerrit-Reviewer: Tom Van Goethem <t...@chromium.org>
              Gerrit-Reviewer: Vasiliy Telezhnikov <vas...@chromium.org>
              Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
              open
              diffy
              satisfied_requirement
              Reply all
              Reply to author
              Forward
              0 new messages