Bug 1740295 [wpt PR 31560] - GetTopExecutionContext method for Canvas rendering conte...
commitca9f7cb4e6560de4d39276fc8f13919b8ab1917d
authorAaron Krajeski <aaronhk@chromium.org>
Sat, 13 Nov 2021 10:06:42 +0000 (13 10:06 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Mon, 15 Nov 2021 12:00:46 +0000 (15 12:00 +0000)
tree6c17bcbd315abf13bae74be7f6f4763812905719
parent21632c0c1789711dd5791019d410cb0a1812627f
Bug 1740295 [wpt PR 31560] - GetTopExecutionContext method for Canvas rendering contexts, a=testonly

Automatic update from web-platform-tests
GetTopExecutionContext method for Canvas rendering contexts

BaseRenderingContext2D and CanvasPath access UMA, UseCounters and
RuntimeFlags through
GetCanvasRenderingContextHost()->GetTopExecutionContext(). This doesn't
work and has never worked for PaintRenderingContexts as there is no
class that works as a "host" for these contexts.

This CL adds a GetTopExecutionContext() function to all canvas rendering
2d contexts that returns a pointer to the execution context directly.
For canvas elements and offscreen canvases, this works exactly as before
(i.e. host->execution_context). For paint rendering contexts a pointer
to the PaintWorkletGlobalScope is passed in on creation.

Before this change some new Canvas2D API features would cause crashes
in paint worklets.

Change-Id: Icb6529c285d1aff2c001291a4387c613fb24fba7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3260452
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Aaron Krajeski <aaronhk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940114}

--

wpt-commits: 755553ec4f8eb116eea31556a6cfc83b18bcde1d
wpt-pr: 31560
testing/web-platform/tests/css/css-paint-api/roundrect-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-paint-api/roundrect.https.html [new file with mode: 0644]