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

Issue 270473003: Make gMask_00FF00FF a constant (Closed)

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

Description

Make gMask_00FF00FF a constant This is to optimize SkAlphaMulQ() in PIC mode. With the visibility=default symbol the constant is not known at compile time (and is not a constant), but instead is fetched through a double indirection through GOT. The function is quite hot on one of the chromium benchmarks: rasterize_and_record_micro.key_silk_cases. This change replaces the symbol with a compile-time constant. As a bonus the variable is not exported from the dynamic library, i. e. a cleaner library interface. See specific performance improvements on Android here: http://goo.gl/iMuTDt Committed: http://code.google.com/p/skia/source/detail?r=14696

Patch Set 1 #

Total comments: 2

Patch Set 2 : replace enum constant with the literal #

Total comments: 8

Patch Set 3 : const mask no-static #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -18 lines) Patch
M include/core/SkColorPriv.h View 1 2 chunks +1 line, -5 lines 0 comments Download
M src/core/SkBitmapProcState_filter.h View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
M src/core/SkBlitMask_D32.cpp View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/core/SkBlitter.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M src/opts/SkColor_opts_SSE2.h View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
pasko
Tom, Sami, please advise on proper reviewers for this. How would you suggest to test ...
6 years, 7 months ago (2014-05-06 16:07:49 UTC) #1
Sami
Neat find. Did you notice any difference in the rasterize_time from rasterize_and_record_micro? Do we know ...
6 years, 7 months ago (2014-05-06 16:15:36 UTC) #2
pasko
On 2014/05/06 16:15:36, Sami wrote: > Neat find. Did you notice any difference in the ...
6 years, 7 months ago (2014-05-06 16:46:02 UTC) #3
Sami
+random selection of skia folks since Tom is out.
6 years, 7 months ago (2014-05-06 17:21:23 UTC) #4
reed1
For a while at least, making this a global was in fact faster, because the ...
6 years, 7 months ago (2014-05-06 17:24:38 UTC) #5
mtklein
On 2014/05/06 17:24:38, reed1 wrote: > For a while at least, making this a global ...
6 years, 7 months ago (2014-05-06 17:41:44 UTC) #6
pasko
On 2014/05/06 17:24:38, reed1 wrote: > For a while at least, making this a global ...
6 years, 7 months ago (2014-05-12 14:35:30 UTC) #7
reed1
lgtm https://codereview.chromium.org/270473003/diff/1/include/core/SkMath.h File include/core/SkMath.h (right): https://codereview.chromium.org/270473003/diff/1/include/core/SkMath.h#newcode17 include/core/SkMath.h:17: enum { kMask_00FF00FF = 0xFF00FF }; I think ...
6 years, 7 months ago (2014-05-12 14:48:06 UTC) #8
reed1
oops, not lgtm (until we can eliminate the enum)
6 years, 7 months ago (2014-05-12 15:04:59 UTC) #9
pasko
https://codereview.chromium.org/270473003/diff/1/include/core/SkMath.h File include/core/SkMath.h (right): https://codereview.chromium.org/270473003/diff/1/include/core/SkMath.h#newcode17 include/core/SkMath.h:17: enum { kMask_00FF00FF = 0xFF00FF }; On 2014/05/12 14:48:07, ...
6 years, 7 months ago (2014-05-12 15:06:18 UTC) #10
reed1
lgtm I wonder about the 'static' in the filter file, but I concede that need ...
6 years, 7 months ago (2014-05-12 15:08:34 UTC) #11
pasko
let me know if you'd prefer s/mask/kMask/ https://codereview.chromium.org/270473003/diff/20001/src/core/SkBitmapProcState_filter.h File src/core/SkBitmapProcState_filter.h (right): https://codereview.chromium.org/270473003/diff/20001/src/core/SkBitmapProcState_filter.h#newcode29 src/core/SkBitmapProcState_filter.h:29: static const ...
6 years, 7 months ago (2014-05-12 15:19:45 UTC) #12
reed1
lgtm
6 years, 7 months ago (2014-05-12 15:20:46 UTC) #13
tomhudson
The CQ bit was checked by tomhudson@google.com
6 years, 7 months ago (2014-05-12 15:30:44 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/pasko@chromium.org/270473003/40001
6 years, 7 months ago (2014-05-12 15:31:50 UTC) #15
commit-bot: I haz the power
6 years, 7 months ago (2014-05-12 15:38:08 UTC) #16
Message was sent while issue was closed.
Change committed as 14696

Powered by Google App Engine
This is Rietveld 408576698