Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Issue 169283008: Maintain SkPaint in GraphicsContextState. (Closed)

Created:
6 years, 10 months ago by Stephen Chennney
Modified:
6 years, 9 months ago
CC:
blink-reviews, jamesr, krit, dsinclair, jbroman, danakj, Rik, pdr., rwlbuis
Visibility:
Public.

Description

Maintain SkPaint in GraphicsContextState. The aim is to avoid SkPaint setup time for the common case of filling and stroking shapes. We can't entirely do that, as some of the paint content is not controlled by GraphicsContextState (such as text or temporary paint state set for specific draw operations). Perf tests on the record_and_rasterize micro-bench indicate a 1-3% average improvement on record times. BUG=343240 R=adamk@chromium.org, fmalita@chromium.org, senorblanco@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=168536

Patch Set 1 #

Patch Set 2 : Fixed alpha, still work in progress #

Patch Set 3 : Ready for review. #

Total comments: 19

Patch Set 4 : Improved based on review #

Total comments: 2

Patch Set 5 : Nuked pointless const #

Total comments: 7

Patch Set 6 : A couple more optimizations. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+502 lines, -315 lines) Patch
M Source/core/html/canvas/CanvasRenderingContext2D.cpp View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/rendering/RenderEmbeddedObject.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceGradient.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourcePattern.cpp View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResourceSolidColor.cpp View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M Source/platform/blink_platform.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/platform/graphics/CrossfadeGeneratedImage.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/graphics/Gradient.h View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M Source/platform/graphics/Gradient.cpp View 1 2 3 1 chunk +6 lines, -6 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.h View 1 2 3 6 chunks +44 lines, -50 lines 0 comments Download
M Source/platform/graphics/GraphicsContext.cpp View 1 2 3 4 5 34 chunks +54 lines, -161 lines 0 comments Download
M Source/platform/graphics/GraphicsContextState.h View 1 2 3 4 3 chunks +99 lines, -63 lines 0 comments Download
A Source/platform/graphics/GraphicsContextState.cpp View 1 2 3 4 1 chunk +256 lines, -0 lines 0 comments Download
M Source/platform/graphics/StrokeData.h View 1 2 3 4 2 chunks +13 lines, -9 lines 0 comments Download
M Source/platform/graphics/StrokeData.cpp View 1 2 3 3 chunks +10 lines, -7 lines 0 comments Download
M Source/web/tests/GraphicsContextTest.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Stephen Chennney
Note that this is not ready for review yet. I have fixed all the bugs, ...
6 years, 10 months ago (2014-02-26 22:19:02 UTC) #1
Stephen Chennney
On 2014/02/26 22:19:02, Stephen Chenney wrote: > Note that this is not ready for review ...
6 years, 9 months ago (2014-02-28 00:48:02 UTC) #2
Stephen Chennney
Review please. Pretty please.
6 years, 9 months ago (2014-03-03 17:20:27 UTC) #3
f(malita)
On 2014/03/03 17:20:27, Stephen Chenney wrote: > Review please. Pretty please. Sorry, I missed the ...
6 years, 9 months ago (2014-03-03 17:50:30 UTC) #4
f(malita)
On 2014/02/28 00:48:02, Stephen Chenney wrote: > 1) The Gradient changes are to allow GraphicsContext ...
6 years, 9 months ago (2014-03-03 22:46:21 UTC) #5
Stephen Chennney
Thanks. The gradient change is due to the canvas spec. You create a gradient and ...
6 years, 9 months ago (2014-03-04 13:20:35 UTC) #6
f(malita)
On 2014/03/04 13:20:35, Stephen Chenney wrote: > The gradient change is due to the canvas ...
6 years, 9 months ago (2014-03-04 14:23:28 UTC) #7
f(malita)
https://codereview.chromium.org/169283008/diff/100001/Source/platform/graphics/Gradient.h File Source/platform/graphics/Gradient.h (right): https://codereview.chromium.org/169283008/diff/100001/Source/platform/graphics/Gradient.h#newcode75 Source/platform/graphics/Gradient.h:75: bool shaderChanged() const { return m_shaderChanged; } How about ...
6 years, 9 months ago (2014-03-04 14:23:46 UTC) #8
Stephen Chennney
Done. Just need to build and test. https://codereview.chromium.org/169283008/diff/100001/Source/platform/graphics/Gradient.h File Source/platform/graphics/Gradient.h (right): https://codereview.chromium.org/169283008/diff/100001/Source/platform/graphics/Gradient.h#newcode75 Source/platform/graphics/Gradient.h:75: bool shaderChanged() ...
6 years, 9 months ago (2014-03-04 14:47:10 UTC) #9
Stephen White
Some parts of the API now have small inconsistencies, and surprising corner cases. It would ...
6 years, 9 months ago (2014-03-04 15:24:13 UTC) #10
Stephen Chennney
Thanks. I've hopefully explained why things are as they are, and I'll fix the things ...
6 years, 9 months ago (2014-03-04 17:41:29 UTC) #11
Stephen Chennney
Need a review for a method rename in Source/web/tests/GraphicsContextTest.cpp
6 years, 9 months ago (2014-03-05 01:51:07 UTC) #12
jbroman
Don't mean to butt in here, but I saw one thing which looked unusual (possibly ...
6 years, 9 months ago (2014-03-05 02:00:47 UTC) #13
jamesr
https://codereview.chromium.org/169283008/diff/140001/Source/platform/graphics/GraphicsContextState.h File Source/platform/graphics/GraphicsContextState.h (right): https://codereview.chromium.org/169283008/diff/140001/Source/platform/graphics/GraphicsContextState.h#newcode69 Source/platform/graphics/GraphicsContextState.h:69: void setStrokeStyle(const StrokeStyle); On 2014/03/05 02:00:47, jbroman wrote: > ...
6 years, 9 months ago (2014-03-05 02:02:12 UTC) #14
Stephen White
LGTM https://codereview.chromium.org/169283008/diff/180001/Source/platform/graphics/GraphicsContext.cpp File Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/169283008/diff/180001/Source/platform/graphics/GraphicsContext.cpp#newcode609 Source/platform/graphics/GraphicsContext.cpp:609: SkPaint paint(immutableState()->fillPaint()); Nit: is it necessary to copy-construct ...
6 years, 9 months ago (2014-03-05 13:39:01 UTC) #15
f(malita)
lgtm https://codereview.chromium.org/169283008/diff/180001/Source/platform/graphics/GraphicsContextState.h File Source/platform/graphics/GraphicsContextState.h (right): https://codereview.chromium.org/169283008/diff/180001/Source/platform/graphics/GraphicsContextState.h#newcode148 Source/platform/graphics/GraphicsContextState.h:148: return (c & 0x00FFFFFF) | (a << 24); ...
6 years, 9 months ago (2014-03-05 14:09:25 UTC) #16
Stephen Chennney
Done done. And one more patch that avoids some computation. https://codereview.chromium.org/169283008/diff/180001/Source/platform/graphics/GraphicsContext.cpp File Source/platform/graphics/GraphicsContext.cpp (right): https://codereview.chromium.org/169283008/diff/180001/Source/platform/graphics/GraphicsContext.cpp#newcode609 ...
6 years, 9 months ago (2014-03-05 16:17:10 UTC) #17
adamk
lgtm for Source/web/
6 years, 9 months ago (2014-03-05 19:33:36 UTC) #18
Stephen Chennney
The CQ bit was checked by schenney@chromium.org
6 years, 9 months ago (2014-03-05 19:35:20 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/schenney@chromium.org/169283008/200001
6 years, 9 months ago (2014-03-05 19:35:32 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/schenney@chromium.org/169283008/200001
6 years, 9 months ago (2014-03-05 21:00:55 UTC) #21
Stephen Chennney
6 years, 9 months ago (2014-03-05 22:12:19 UTC) #22
Message was sent while issue was closed.
Committed patchset #6 manually as r168536 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698