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

Issue 263063002: Add pattern matchers for SkRecord (Closed)

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

Description

Add pattern matchers for SkRecord This is a mid-level library for finding patterns of commands in an SkRecord. At the API level, it's a bit regex inspired. Some examples: - Pattern1<Is<DrawRect>> matches a single DrawRect - Pattern1<Star<Is<DrawRect>>> matches 0 or more DrawRects - Pattern2<Is<ClipRect>, Is<DrawRect>> matches a single clip rect followed by a single draw rect - Pattern3<Is<Save>, Star<IsDraw>, Is<Restore>> matches a single Save, followed by any number of Draws, followed by Restore - Pattern1<Or<Is<DrawRect>, Is<ClipRect>>> matches a DrawRect or a ClipRect - Pattern1<Not<Is<ClipRect>>> matches a command that's notClipRect. Once you have a pattern, you can call .search() on it to step through ranges of matching commands. This means patterns can replace most of the custom iteration logic for optimization passes: the generic pattern searching steps through all the optimization candidates, which optimization-specific code further inspects and mutates. SkRecordTraits is now unused. Bye bye! Generated code and performance of SkRecordOpts is very similar to what it was before. (I had to use SK_ALWAYS_INLINE in a few places to make this so.) BUG=skia:2378 Committed: http://code.google.com/p/skia/source/detail?r=14582

Patch Set 1 #

Patch Set 2 : bug #

Patch Set 3 : new test #

Patch Set 4 : always start from last end #

Patch Set 5 : hammer SK_ALWAYS_INLINE until code generation looks good #

Patch Set 6 : remove unused SkRecordTraits #

Patch Set 7 : port opts where possible #

Patch Set 8 : syntax sugar #

Patch Set 9 : test and fix Star storage #

Patch Set 10 : comments and refactoring #

Patch Set 11 : rebase #

Patch Set 12 : notes #

Patch Set 13 : yet more notes #

Total comments: 2

Patch Set 14 : ben #

Total comments: 4

Patch Set 15 : fix comment #

Patch Set 16 : init pointers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+543 lines, -175 lines) Patch
M gyp/tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M src/record/SkRecordOpts.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +121 lines, -144 lines 0 comments Download
A src/record/SkRecordPattern.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +219 lines, -0 lines 0 comments Download
D src/record/SkRecordTraits.h View 1 2 3 4 5 1 chunk +0 lines, -31 lines 0 comments Download
M src/utils/SkTLogic.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +10 lines, -0 lines 0 comments Download
A tests/RecordPatternTest.cpp View 1 2 3 4 5 6 7 8 1 chunk +192 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
mtklein
Once again, Ben for SkTLogic, Florin for the rest!
6 years, 7 months ago (2014-05-05 18:27:14 UTC) #1
bungeman-skia
I'm going to think about it for a minute, but here's my initial thoughts. https://codereview.chromium.org/263063002/diff/210001/src/utils/SkTLogic.h ...
6 years, 7 months ago (2014-05-05 19:37:50 UTC) #2
mtklein
https://codereview.chromium.org/263063002/diff/210001/src/utils/SkTLogic.h File src/utils/SkTLogic.h (right): https://codereview.chromium.org/263063002/diff/210001/src/utils/SkTLogic.h#newcode98 src/utils/SkTLogic.h:98: Strongly agreed and done.
6 years, 7 months ago (2014-05-05 20:05:11 UTC) #3
bungeman-skia
logic / traits lgtm
6 years, 7 months ago (2014-05-05 20:16:43 UTC) #4
f(malita)
template voodoo DSL FTW!!! lgtm https://codereview.chromium.org/263063002/diff/230001/src/record/SkRecordOpts.cpp File src/record/SkRecordOpts.cpp (right): https://codereview.chromium.org/263063002/diff/230001/src/record/SkRecordOpts.cpp#newcode158 src/record/SkRecordOpts.cpp:158: // There's no efficient ...
6 years, 7 months ago (2014-05-05 20:52:58 UTC) #5
mtklein
https://codereview.chromium.org/263063002/diff/230001/src/record/SkRecordOpts.cpp File src/record/SkRecordOpts.cpp (right): https://codereview.chromium.org/263063002/diff/230001/src/record/SkRecordOpts.cpp#newcode158 src/record/SkRecordOpts.cpp:158: // There's no efficient way (yet?) to express this ...
6 years, 7 months ago (2014-05-05 21:43:31 UTC) #6
mtklein
The CQ bit was checked by mtklein@google.com
6 years, 7 months ago (2014-05-05 21:45:34 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/263063002/250001
6 years, 7 months ago (2014-05-05 21:45:54 UTC) #8
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-05 21:52:45 UTC) #9
commit-bot: I haz the power
Retried try job too often on Build-Ubuntu13.10-GCC4.8-x86_64-Release-Trybot for step(s) BuildTests http://skia-tree-status.appspot.com/redirect/compile-buildbots/buildstatus?builder=Build-Ubuntu13.10-GCC4.8-x86_64-Release-Trybot&number=2310
6 years, 7 months ago (2014-05-05 21:52:45 UTC) #10
mtklein
The CQ bit was checked by mtklein@google.com
6 years, 7 months ago (2014-05-05 21:53:32 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@chromium.org/263063002/270001
6 years, 7 months ago (2014-05-05 21:54:10 UTC) #12
commit-bot: I haz the power
6 years, 7 months ago (2014-05-05 21:59:59 UTC) #13
Message was sent while issue was closed.
Change committed as 14582

Powered by Google App Engine
This is Rietveld 408576698