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

Issue 52603004: Implement SSE2-based implementations of the morphology filters (dilate & (Closed)

Created:
7 years, 1 month ago by Stephen White
Modified:
7 years, 1 month ago
Reviewers:
mtklein, reed1
CC:
skia-review_googlegroups.com, robertphillips
Visibility:
Public.

Description

Implement SSE2-based implementations of the morphology filters (dilate & erode). This gives a 3-5X speedup over the naive implementation, and also mitigates a timing-based security attack in Chrome (https://code.google.com/p/chromium/issues/detail?id=251711). NOTE: this will require a corresponding GYP change on the Skia roll into Chrome: https://codereview.chromium.org/52453004/ R=mtklein@google.com, reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=12038

Patch Set 1 #

Patch Set 2 : Fix typo in dilateY() #

Total comments: 10

Patch Set 3 : Templatify stuff. Fix style. Use an enum. Add comments. #

Patch Set 4 : Do the width/height swap at the call sites, where it used to be. #

Patch Set 5 : Fix the non-SSE2 build. #

Total comments: 4

Patch Set 6 : Fix style issues, change bools -> enums #

Patch Set 7 : Tweak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -16 lines) Patch
M gyp/effects.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M gyp/opts.gyp View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M src/effects/SkMorphologyImageFilter.cpp View 1 2 3 4 5 4 chunks +45 lines, -16 lines 0 comments Download
A src/opts/SkMorphology_opts.h View 1 2 3 4 5 1 chunk +27 lines, -0 lines 0 comments Download
A src/opts/SkMorphology_opts_SSE2.h View 1 chunk +15 lines, -0 lines 0 comments Download
A src/opts/SkMorphology_opts_SSE2.cpp View 1 2 3 4 5 6 1 chunk +78 lines, -0 lines 0 comments Download
A src/opts/SkMorphology_opts_none.cpp View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download
M src/opts/opts_check_SSE2.cpp View 1 2 3 4 5 2 chunks +20 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Stephen White
reed@: PTAL. Thanks!
7 years, 1 month ago (2013-10-30 15:08:43 UTC) #1
reed1
do we already have tests and benches for these? https://codereview.chromium.org/52603004/diff/30001/src/effects/SkMorphologyImageFilter.cpp File src/effects/SkMorphologyImageFilter.cpp (right): https://codereview.chromium.org/52603004/diff/30001/src/effects/SkMorphologyImageFilter.cpp#newcode78 src/effects/SkMorphologyImageFilter.cpp:78: ...
7 years, 1 month ago (2013-10-30 15:15:04 UTC) #2
mtklein
https://codereview.chromium.org/52603004/diff/30001/src/opts/SkMorphology_opts.h File src/opts/SkMorphology_opts.h (right): https://codereview.chromium.org/52603004/diff/30001/src/opts/SkMorphology_opts.h#newcode11 src/opts/SkMorphology_opts.h:11: int width, int height, int srcStride, int dstStride); On ...
7 years, 1 month ago (2013-10-30 15:44:47 UTC) #3
reed1
https://codereview.chromium.org/52603004/diff/30001/src/opts/SkMorphology_opts.h File src/opts/SkMorphology_opts.h (right): https://codereview.chromium.org/52603004/diff/30001/src/opts/SkMorphology_opts.h#newcode11 src/opts/SkMorphology_opts.h:11: int width, int height, int srcStride, int dstStride); On ...
7 years, 1 month ago (2013-10-30 15:49:52 UTC) #4
Stephen White
New patch up. https://codereview.chromium.org/52603004/diff/30001/src/effects/SkMorphologyImageFilter.cpp File src/effects/SkMorphologyImageFilter.cpp (right): https://codereview.chromium.org/52603004/diff/30001/src/effects/SkMorphologyImageFilter.cpp#newcode78 src/effects/SkMorphologyImageFilter.cpp:78: if (SkMorphologyProc erodeXProc = SkErodeXGetPlatformProc()) { ...
7 years, 1 month ago (2013-10-30 19:47:17 UTC) #5
mtklein
On 2013/10/30 19:47:17, Stephen White wrote: > New patch up. > > https://codereview.chromium.org/52603004/diff/30001/src/effects/SkMorphologyImageFilter.cpp > File ...
7 years, 1 month ago (2013-10-30 20:02:20 UTC) #6
reed1
lgtm w/ skia naming nits https://codereview.chromium.org/52603004/diff/270001/src/effects/SkMorphologyImageFilter.cpp File src/effects/SkMorphologyImageFilter.cpp (right): https://codereview.chromium.org/52603004/diff/270001/src/effects/SkMorphologyImageFilter.cpp#newcode42 src/effects/SkMorphologyImageFilter.cpp:42: template<bool inX> very nice ...
7 years, 1 month ago (2013-10-30 20:14:28 UTC) #7
Stephen White
https://codereview.chromium.org/52603004/diff/270001/src/effects/SkMorphologyImageFilter.cpp File src/effects/SkMorphologyImageFilter.cpp (right): https://codereview.chromium.org/52603004/diff/270001/src/effects/SkMorphologyImageFilter.cpp#newcode42 src/effects/SkMorphologyImageFilter.cpp:42: template<bool inX> On 2013/10/30 20:14:28, reed1 wrote: > very ...
7 years, 1 month ago (2013-10-30 20:48:06 UTC) #8
Stephen White
Committed patchset #7 manually as r12038 (presubmit successful).
7 years, 1 month ago (2013-10-30 21:57:11 UTC) #9
Stephen White
7 years, 1 month ago (2013-10-31 18:28:48 UTC) #10
Message was sent while issue was closed.
On 2013/10/30 15:15:04, reed1 wrote:
> do we already have tests and benches for these?

Forgot to answer this: yes we do. :) GM:morphology, plus:

http://0.skia-gwt-dash.chrome-skia.ic.borg.google.com:25912/Skp.html#b-416-41...

Powered by Google App Engine
This is Rietveld 408576698