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

Issue 245963010: Move SkShader::fLocalMatrix into SkShader constructor. (Closed)

Created:
6 years, 8 months ago by Dominik Grewe
Modified:
6 years, 7 months ago
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Move SkShader::fLocalMatrix into SkShader constructor. As a first step towards removing SkShader::setLocalMatrix, which will make SkShader thread-safe, remove calls to setLocalMatrix that happen immediately after the shader is being created. Instead, pass the matrix into the constructor or factory method. BUG=skia:1976 Committed: http://code.google.com/p/skia/source/detail?r=14401

Patch Set 1 #

Patch Set 2 : uncomment setLocalMatrix #

Total comments: 8

Patch Set 3 : add SkLocalMatrixShaderWrapper #

Total comments: 15

Patch Set 4 : nits; unref() #

Total comments: 1

Patch Set 5 : Remove wrapper #

Total comments: 3

Patch Set 6 : rebase; remove localMatrix param from SkColorShader constructor. #

Total comments: 1

Patch Set 7 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+321 lines, -279 lines) Patch
M gm/aarectmodes.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M gm/bigmatrix.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M gm/bitmapshader.cpp View 3 chunks +3 lines, -4 lines 0 comments Download
M gm/clippedbitmapshaders.cpp View 1 chunk +4 lines, -5 lines 0 comments Download
M gm/colortype.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M gm/convexpolyclip.cpp View 1 chunk +6 lines, -6 lines 0 comments Download
M gm/drawbitmaprect.cpp View 1 chunk +6 lines, -6 lines 0 comments Download
M gm/giantbitmap.cpp View 2 chunks +1 line, -2 lines 0 comments Download
M gm/gradient_matrix.cpp View 1 2 chunks +7 lines, -7 lines 0 comments Download
M gm/gradients.cpp View 6 chunks +23 lines, -17 lines 0 comments Download
M gm/gradients_2pt_conical.cpp View 1 12 chunks +86 lines, -59 lines 0 comments Download
M gm/hairmodes.cpp View 1 chunk +4 lines, -6 lines 0 comments Download
M gm/mixedxfermodes.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M gm/shaderbounds.cpp View 4 chunks +5 lines, -5 lines 0 comments Download
M gm/shadertext2.cpp View 1 2 3 4 5 2 chunks +4 lines, -5 lines 0 comments Download
M gm/shadertext3.cpp View 1 chunk +5 lines, -4 lines 0 comments Download
M gm/xfermodes.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M gm/xfermodes2.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M gm/xfermodes3.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M include/core/SkShader.h View 1 3 4 2 chunks +3 lines, -2 lines 0 comments Download
M include/effects/SkGradientShader.h View 5 chunks +10 lines, -5 lines 0 comments Download
M samplecode/SampleAARectModes.cpp View 1 chunk +5 lines, -6 lines 0 comments Download
M samplecode/SampleCamera.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M samplecode/SampleColorFilter.cpp View 1 chunk +2 lines, -5 lines 0 comments Download
M samplecode/SampleDash.cpp View 1 1 chunk +1 line, -2 lines 0 comments Download
M samplecode/SampleFatBits.cpp View 1 2 3 4 1 chunk +2 lines, -5 lines 0 comments Download
M samplecode/SampleHairModes.cpp View 1 chunk +5 lines, -6 lines 0 comments Download
M samplecode/SampleLayers.cpp View 2 chunks +7 lines, -9 lines 0 comments Download
M samplecode/SampleXfermodesBlur.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M src/animator/SkDrawGradient.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M src/animator/SkDrawShader.cpp View 2 chunks +4 lines, -5 lines 0 comments Download
M src/animator/SkPaintPart.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkBitmapDevice.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkBitmapProcShader.h View 2 chunks +3 lines, -2 lines 0 comments Download
M src/core/SkBitmapProcShader.cpp View 1 2 3 4 5 3 chunks +6 lines, -5 lines 0 comments Download
M src/core/SkComposeShader.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkDraw.cpp View 1 2 chunks +6 lines, -7 lines 0 comments Download
M src/core/SkPictureShader.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M src/core/SkShader.cpp View 1 2 3 4 5 6 3 chunks +11 lines, -10 lines 0 comments Download
M src/core/SkSmallAllocator.h View 1 chunk +10 lines, -0 lines 0 comments Download
M src/effects/SkTileImageFilter.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 2 3 4 5 12 chunks +19 lines, -12 lines 0 comments Download
M src/effects/gradients/SkGradientShaderPriv.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/effects/gradients/SkLinearGradient.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/effects/gradients/SkLinearGradient.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M src/effects/gradients/SkRadialGradient.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/effects/gradients/SkRadialGradient.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkSweepGradient.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/effects/gradients/SkSweepGradient.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M src/effects/gradients/SkTwoPointConicalGradient.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M src/effects/gradients/SkTwoPointRadialGradient.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/effects/gradients/SkTwoPointRadialGradient.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M tests/DrawBitmapRectTest.cpp View 2 chunks +2 lines, -3 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Dominik Grewe
Assuming the first patch gets "re-reverted", here's my current WIP on fLocalMatrix. I've moved calls ...
6 years, 8 months ago (2014-04-23 17:19:06 UTC) #1
scroggo
On 2014/04/23 17:19:06, Dominik Grewe wrote: > I've not looked into Chromium/Blink yet. There are ...
6 years, 8 months ago (2014-04-23 19:01:27 UTC) #2
reed1
Boy, time to kill SkUnitMapper... any android objections?
6 years, 8 months ago (2014-04-23 23:54:20 UTC) #3
reed1
macro comment: 1. I kind of like the option of specifying the matrix up front. ...
6 years, 8 months ago (2014-04-23 23:55:55 UTC) #4
Dominik Grewe
I've added a new wrapper class: SkLocalMatrixShaderWrapper. I replaced all remaining setLocalMatrix calls with it ...
6 years, 8 months ago (2014-04-24 15:47:17 UTC) #5
scroggo
On 2014/04/23 23:54:20, reed1 wrote: > Boy, time to kill SkUnitMapper... any android objections? No. ...
6 years, 8 months ago (2014-04-24 17:02:53 UTC) #6
Dominik Grewe
https://codereview.chromium.org/245963010/diff/60001/include/core/SkShader.h File include/core/SkShader.h (right): https://codereview.chromium.org/245963010/diff/60001/include/core/SkShader.h#newcode394 include/core/SkShader.h:394: * @return Returns a new shader object. Note: this ...
6 years, 8 months ago (2014-04-24 17:16:46 UTC) #7
scroggo
https://codereview.chromium.org/245963010/diff/60001/include/core/SkShader.h File include/core/SkShader.h (right): https://codereview.chromium.org/245963010/diff/60001/include/core/SkShader.h#newcode455 include/core/SkShader.h:455: SkLocalMatrixShaderWrapper(SkShader* shader, const SkMatrix& localMatrix); On 2014/04/24 17:16:47, Dominik ...
6 years, 8 months ago (2014-04-24 18:24:46 UTC) #8
Dominik Grewe
Having thought about how to implement the wrapper and after a discussion with Sami, here's ...
6 years, 8 months ago (2014-04-25 11:02:11 UTC) #9
Dominik Grewe
On 2014/04/25 11:02:11, Dominik Grewe wrote: > Having thought about how to implement the wrapper ...
6 years, 8 months ago (2014-04-25 13:09:35 UTC) #10
scroggo
On 2014/04/25 11:02:11, Dominik Grewe wrote: > Having thought about how to implement the wrapper ...
6 years, 8 months ago (2014-04-25 15:06:44 UTC) #11
reed1
1. I'm good with adding an optional LM (local matrix) to the factories. 2. I ...
6 years, 8 months ago (2014-04-25 16:15:25 UTC) #12
scroggo
On 2014/04/25 16:15:25, reed1 wrote: > 1. I'm good with adding an optional LM (local ...
6 years, 8 months ago (2014-04-25 16:22:35 UTC) #13
scroggo
On 2014/04/25 16:22:35, scroggo wrote: > On 2014/04/25 16:15:25, reed1 wrote: > > 1. I'm ...
6 years, 8 months ago (2014-04-25 16:22:52 UTC) #14
Dominik Grewe
On 2014/04/25 16:22:52, scroggo wrote: > On 2014/04/25 16:22:35, scroggo wrote: > > On 2014/04/25 ...
6 years, 8 months ago (2014-04-25 16:27:12 UTC) #15
reed1
On 2014/04/25 16:27:12, Dominik Grewe wrote: > On 2014/04/25 16:22:52, scroggo wrote: > > On ...
6 years, 8 months ago (2014-04-25 16:28:18 UTC) #16
scroggo
On 2014/04/25 16:22:52, scroggo wrote: > On 2014/04/25 16:22:35, scroggo wrote: > > On 2014/04/25 ...
6 years, 8 months ago (2014-04-25 16:28:58 UTC) #17
Dominik Grewe
On 2014/04/25 16:28:58, scroggo wrote: > On 2014/04/25 16:22:52, scroggo wrote: > > On 2014/04/25 ...
6 years, 8 months ago (2014-04-25 16:29:54 UTC) #18
Dominik Grewe
Currently only those shader classes have an optional LM parameter in their constructur that need ...
6 years, 8 months ago (2014-04-25 17:50:15 UTC) #19
scroggo
lgtm, modulo breaking chrome build. https://codereview.chromium.org/245963010/diff/100001/gm/shadertext2.cpp File gm/shadertext2.cpp (right): https://codereview.chromium.org/245963010/diff/100001/gm/shadertext2.cpp#newcode102 gm/shadertext2.cpp:102: SkShader::kRepeat_TileMode)); On 2014/04/25 17:50:15, ...
6 years, 8 months ago (2014-04-25 17:58:32 UTC) #20
reed1
On 2014/04/25 17:58:32, scroggo wrote: > lgtm, modulo breaking chrome build. > > https://codereview.chromium.org/245963010/diff/100001/gm/shadertext2.cpp > ...
6 years, 8 months ago (2014-04-25 18:11:18 UTC) #21
Dominik Grewe
I've removed the localMatrix parameter from SkColor's constructor. Chromium is now building fine (also because ...
6 years, 8 months ago (2014-04-28 09:43:04 UTC) #22
Dominik Grewe
The CQ bit was checked by dominikg@chromium.org
6 years, 8 months ago (2014-04-28 09:58:46 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/dominikg@chromium.org/245963010/120001
6 years, 8 months ago (2014-04-28 09:59:05 UTC) #24
scroggo
https://codereview.chromium.org/245963010/diff/120001/src/core/SkShader.cpp File src/core/SkShader.cpp (right): https://codereview.chromium.org/245963010/diff/120001/src/core/SkShader.cpp#newcode262 src/core/SkShader.cpp:262: color = shader.fColor; nit: no need to separate declaration ...
6 years, 7 months ago (2014-04-28 13:11:57 UTC) #25
Dominik Grewe
The CQ bit was unchecked by dominikg@chromium.org
6 years, 7 months ago (2014-04-28 13:14:30 UTC) #26
Dominik Grewe
The CQ bit was checked by dominikg@chromium.org
6 years, 7 months ago (2014-04-28 13:37:37 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/dominikg@chromium.org/245963010/140001
6 years, 7 months ago (2014-04-28 13:37:56 UTC) #28
commit-bot: I haz the power
6 years, 7 months ago (2014-04-28 14:56:27 UTC) #29
Message was sent while issue was closed.
Change committed as 14401

Powered by Google App Engine
This is Rietveld 408576698