[wpt-sync] Sync PR 39710 - Optimize 2D Canvas style setters
Categories
(Core :: Graphics: Canvas2D, task, P4)
Tracking
()
Tracking | Status | |
---|---|---|
firefox115 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 39710 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/39710
Details from upstream follow.
Justin Novosad <junov@chromium.org> wrote:
Optimize 2D Canvas style setters
This CL eliminates unnecessary conditional branches, switch statements
and function call overhead when setting the fillStyle and strokeStyle
attributes of CanvasRenderingContext2D.This change also updates the 2d.gradient.object.update.html tests to
make them more robust. Before this change, blink was not spec
compliant and the existing test did not catch it. The problem
was that because blink was deferring the evaluation of the
CanvasGradient until the time of first draw, it was catching changes
to the CanvasGradient that were made after setting fillStyle. So the
test was not robust enough to truly verify that the CanvasGradient
object is live. The test now modifies the CanvasGradient between
consecutive draws, which is the test that the old implementation would
have failed because the gradient would have been baked-in after the
first draw.This change improves MotionMark Canvas Lines by 0.4% on M1 MacOS
Bug: 1430274
Change-Id: Iaaad63df54eeb62c3ae91f621922976c5a82d0b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4407944
Reviewed-by: Jean-Philippe Gravel \<jpgravel@chromium.org>
Reviewed-by: Aaron Krajeski \<aaronhk@chromium.org>
Code-Coverage: Findit \<findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: Justin Novosad \<junov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1136002}
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Assignee | ||
Comment 3•2 years ago
|
||
Assignee | ||
Comment 4•2 years ago
|
||
Comment 6•2 years ago
|
||
bugherder |
Description
•