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

Issue 182983003: Factory methods for heap-allocated SkImageFilter objects. (Closed)

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

Description

Factory methods for heap-allocated SkImageFilter objects. This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkImageFilter and its subclasses non-public and instead provides factory methods for creating these objects on the heap. We temporarily keep constructor of publicly visible classes public behind a flag. BUG=skia:2187 Committed: http://code.google.com/p/skia/source/detail?r=13718

Patch Set 1 #

Patch Set 2 : clean up #

Patch Set 3 : typo #

Total comments: 10

Patch Set 4 : comments #

Total comments: 12

Patch Set 5 : reed's nits #

Total comments: 2

Patch Set 6 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+572 lines, -401 lines) Patch
M bench/BlurImageFilterBench.cpp View 1 chunk +1 line, -1 line 0 comments Download
M bench/DisplacementBench.cpp View 3 chunks +12 lines, -12 lines 0 comments Download
M bench/MagnifierBench.cpp View 1 chunk +1 line, -1 line 0 comments Download
M bench/MatrixConvolutionBench.cpp View 1 chunk +1 line, -1 line 0 comments Download
M bench/MergeBench.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M bench/MorphologyBench.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M gm/bitmapsource.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M gm/colorfilterimagefilter.cpp View 1 chunk +1 line, -1 line 0 comments Download
M gm/displacement.cpp View 1 chunk +95 lines, -95 lines 0 comments Download
M gm/dropshadowimagefilter.cpp View 1 chunk +6 lines, -6 lines 0 comments Download
M gm/imageblur.cpp View 1 chunk +1 line, -1 line 0 comments Download
M gm/imageblurtiled.cpp View 1 chunk +1 line, -1 line 0 comments Download
M gm/imagefiltersbase.cpp View 3 chunks +12 lines, -6 lines 0 comments Download
M gm/imagefiltersclipped.cpp View 1 2 3 4 5 1 chunk +14 lines, -14 lines 0 comments Download
M gm/imagefilterscropped.cpp View 2 chunks +7 lines, -7 lines 0 comments Download
M gm/imagefiltersgraph.cpp View 4 chunks +12 lines, -10 lines 0 comments Download
M gm/imagefiltersscaled.cpp View 1 2 3 4 5 1 chunk +14 lines, -14 lines 0 comments Download
M gm/imagemagnifier.cpp View 1 chunk +1 line, -1 line 0 comments Download
M gm/imageresizetiled.cpp View 1 chunk +1 line, -1 line 0 comments Download
M gm/matrixconvolution.cpp View 1 chunk +9 lines, -9 lines 0 comments Download
M gm/morphology.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M gm/offsetimagefilter.cpp View 1 2 3 4 5 2 chunks +5 lines, -5 lines 0 comments Download
M gm/pictureimagefilter.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M gm/resizeimagefilter.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M gm/spritebitmap.cpp View 1 chunk +1 line, -1 line 0 comments Download
M gm/testimagefilters.cpp View 4 chunks +16 lines, -16 lines 0 comments Download
M gm/tileimagefilter.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M gm/xfermodeimagefilter.cpp View 6 chunks +13 lines, -15 lines 0 comments Download
M include/effects/SkBicubicImageFilter.h View 1 1 chunk +7 lines, -7 lines 0 comments Download
M include/effects/SkBitmapSource.h View 2 chunks +13 lines, -2 lines 0 comments Download
M include/effects/SkBlurImageFilter.h View 1 2 3 2 chunks +15 lines, -4 lines 0 comments Download
M include/effects/SkComposeImageFilter.h View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M include/effects/SkDisplacementMapEffect.h View 1 2 3 4 2 chunks +19 lines, -8 lines 0 comments Download
M include/effects/SkDropShadowImageFilter.h View 1 2 2 chunks +18 lines, -3 lines 0 comments Download
M include/effects/SkMagnifierImageFilter.h View 1 2 3 4 2 chunks +8 lines, -1 line 0 comments Download
M include/effects/SkMatrixConvolutionImageFilter.h View 1 2 3 4 2 chunks +47 lines, -30 lines 0 comments Download
M include/effects/SkMergeImageFilter.h View 1 2 2 chunks +21 lines, -6 lines 0 comments Download
M include/effects/SkMorphologyImageFilter.h View 1 2 3 5 chunks +28 lines, -9 lines 0 comments Download
M include/effects/SkOffsetImageFilter.h View 1 2 2 chunks +10 lines, -2 lines 0 comments Download
M include/effects/SkPictureImageFilter.h View 1 2 3 4 2 chunks +14 lines, -4 lines 0 comments Download
M include/effects/SkResizeImageFilter.h View 1 2 3 chunks +12 lines, -3 lines 0 comments Download
M include/effects/SkTestImageFilters.h View 1 chunk +4 lines, -1 line 0 comments Download
M include/effects/SkTileImageFilter.h View 1 2 2 chunks +11 lines, -3 lines 0 comments Download
M include/effects/SkXfermodeImageFilter.h View 1 2 2 chunks +12 lines, -3 lines 0 comments Download
M samplecode/SampleFilterFuzz.cpp View 4 chunks +16 lines, -16 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M src/effects/SkDropShadowImageFilter.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkMagnifierImageFilter.cpp View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/effects/SkMatrixConvolutionImageFilter.cpp View 1 2 3 4 20 chunks +28 lines, -28 lines 0 comments Download
M src/effects/SkPictureImageFilter.cpp View 1 2 3 4 4 chunks +7 lines, -7 lines 0 comments Download
M tests/GLProgramsTest.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M tests/ImageFilterTest.cpp View 3 chunks +15 lines, -15 lines 0 comments Download
M tests/SerializationTest.cpp View 1 chunk +5 lines, -4 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Dominik Grewe
This is, I believe, the last of the "make paint effects only allocatable on heap" ...
6 years, 9 months ago (2014-03-03 17:17:55 UTC) #1
reed1
https://codereview.chromium.org/182983003/diff/40001/include/effects/SkBlurImageFilter.h File include/effects/SkBlurImageFilter.h (right): https://codereview.chromium.org/182983003/diff/40001/include/effects/SkBlurImageFilter.h#newcode21 include/effects/SkBlurImageFilter.h:21: } nit: LF after } https://codereview.chromium.org/182983003/diff/40001/include/effects/SkDropShadowImageFilter.h File include/effects/SkDropShadowImageFilter.h (right): ...
6 years, 9 months ago (2014-03-03 18:23:19 UTC) #2
scroggo
The CL lgtm. Adding Stephen in case he has any thoughts, but it appears to ...
6 years, 9 months ago (2014-03-03 19:11:53 UTC) #3
Stephen White
LGTM https://codereview.chromium.org/182983003/diff/40001/include/effects/SkBitmapSource.h File include/effects/SkBitmapSource.h (right): https://codereview.chromium.org/182983003/diff/40001/include/effects/SkBitmapSource.h#newcode34 include/effects/SkBitmapSource.h:34: #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS Might want to give Robert a ...
6 years, 9 months ago (2014-03-03 19:48:04 UTC) #4
Dominik Grewe
Thanks. Just need a review from reed@ for changes to the public API. https://codereview.chromium.org/182983003/diff/40001/include/effects/SkBitmapSource.h File ...
6 years, 9 months ago (2014-03-04 10:29:00 UTC) #5
reed1
Before we rev. chrome to use the new factories, perhaps we can take time to ...
6 years, 9 months ago (2014-03-04 16:56:42 UTC) #6
Stephen White
+sugoi, +zork https://codereview.chromium.org/182983003/diff/50001/include/effects/SkDisplacementMapEffect.h File include/effects/SkDisplacementMapEffect.h (right): https://codereview.chromium.org/182983003/diff/50001/include/effects/SkDisplacementMapEffect.h#newcode22 include/effects/SkDisplacementMapEffect.h:22: kKeyBits = 3 // Max value is ...
6 years, 9 months ago (2014-03-04 18:18:00 UTC) #7
Dominik Grewe
When do you want to make all those changes? How about I land this one ...
6 years, 9 months ago (2014-03-07 13:40:28 UTC) #8
reed1
On 2014/03/07 13:40:28, Dominik Grewe wrote: > When do you want to make all those ...
6 years, 9 months ago (2014-03-07 13:55:59 UTC) #9
Dominik Grewe
On 2014/03/07 13:55:59, reed1 wrote: > On 2014/03/07 13:40:28, Dominik Grewe wrote: > > When ...
6 years, 9 months ago (2014-03-07 14:06:32 UTC) #10
reed1
On 2014/03/07 14:06:32, Dominik Grewe wrote: > On 2014/03/07 13:55:59, reed1 wrote: > > On ...
6 years, 9 months ago (2014-03-07 14:07:38 UTC) #11
reed1
On 2014/03/07 14:07:38, reed1 wrote: > On 2014/03/07 14:06:32, Dominik Grewe wrote: > > On ...
6 years, 9 months ago (2014-03-07 14:10:18 UTC) #12
Dominik Grewe
Uploaded PS5. PTAL. https://codereview.chromium.org/182983003/diff/50001/include/effects/SkDisplacementMapEffect.h File include/effects/SkDisplacementMapEffect.h (right): https://codereview.chromium.org/182983003/diff/50001/include/effects/SkDisplacementMapEffect.h#newcode22 include/effects/SkDisplacementMapEffect.h:22: kKeyBits = 3 // Max value ...
6 years, 9 months ago (2014-03-07 16:43:37 UTC) #13
reed1
api lgtm
6 years, 9 months ago (2014-03-07 17:41:50 UTC) #14
Dominik Grewe
The CQ bit was checked by dominikg@chromium.org
6 years, 9 months ago (2014-03-10 10:36:23 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/dominikg@chromium.org/182983003/110001
6 years, 9 months ago (2014-03-10 10:36:33 UTC) #16
commit-bot: I haz the power
Change committed as 13718
6 years, 9 months ago (2014-03-10 10:52:15 UTC) #17
Stephen White
https://codereview.chromium.org/182983003/diff/70001/bench/MatrixConvolutionBench.cpp File bench/MatrixConvolutionBench.cpp (right): https://codereview.chromium.org/182983003/diff/70001/bench/MatrixConvolutionBench.cpp#newcode25 bench/MatrixConvolutionBench.cpp:25: SkIPoint target = SkIPoint::Make(1, 1); Nit: should probably rename ...
6 years, 9 months ago (2014-03-10 20:58:47 UTC) #18
Dominik Grewe
6 years, 9 months ago (2014-03-12 10:05:56 UTC) #19
Message was sent while issue was closed.
https://codereview.chromium.org/182983003/diff/70001/bench/MatrixConvolutionB...
File bench/MatrixConvolutionBench.cpp (right):

https://codereview.chromium.org/182983003/diff/70001/bench/MatrixConvolutionB...
bench/MatrixConvolutionBench.cpp:25: SkIPoint target = SkIPoint::Make(1, 1);
On 2014/03/10 20:58:48, Stephen White wrote:
> Nit: should probably rename this to kernelOffset too.

Thanks for spotting this! I've fixed it (and two other places) in a follow-up
patch: https://codereview.chromium.org/197013003

Powered by Google App Engine
This is Rietveld 408576698