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

Issue 155513012: [WIP] Add Context to SkDrawLooper. (Closed)

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

Description

[WIP] Add Context to SkDrawLooper. SkDrawLooper carries some state during draws. This CL extracts this state into a separate class Context, which is then passed by the users of SkDrawLooper into the appropriate methods. This is a step towards making SkDrawLooper immutable. BUG=skia:2141 Committed: http://code.google.com/p/skia/source/detail?r=13760

Patch Set 1 #

Patch Set 2 : Make methods const. #

Total comments: 8

Patch Set 3 : Move draw logic into context. #

Patch Set 4 : static allocation of DrawContext; update rest of code. #

Total comments: 7

Patch Set 5 : Move size constant to cpp files; add SK_PLACEMENT_SAFE_NEW directives #

Total comments: 2

Patch Set 6 : Add comments. #

Total comments: 8

Patch Set 7 : Implement SK_PLACEMENT_DELETE #

Patch Set 8 : Use SkSmallAllocator #

Total comments: 6

Patch Set 9 : Make SkSmallAllocator private again. #

Total comments: 10

Patch Set 10 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+168 lines, -88 lines) Patch
M include/core/SkDrawLooper.h View 1 2 3 4 5 6 7 8 9 2 chunks +41 lines, -16 lines 0 comments Download
M include/effects/SkBlurDrawLooper.h View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -4 lines 0 comments Download
M include/effects/SkLayerDrawLooper.h View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -5 lines 0 comments Download
M src/core/SkCanvas.cpp View 1 2 3 4 5 6 7 8 9 8 chunks +12 lines, -8 lines 0 comments Download
M src/core/SkDrawLooper.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -6 lines 0 comments Download
D src/core/SkSmallAllocator.h View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -7 lines 0 comments Download
M src/effects/SkBlurDrawLooper.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +15 lines, -11 lines 0 comments Download
M src/effects/SkLayerDrawLooper.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +12 lines, -8 lines 0 comments Download
M tests/LayerDrawLooperTest.cpp View 1 2 3 4 5 6 7 8 9 7 chunks +19 lines, -12 lines 0 comments Download
M tests/QuickRejectTest.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +22 lines, -11 lines 0 comments Download

Messages

Total messages: 40 (0 generated)
reed1
Some rough ideas/questions: 1. Can we allow effects with "small" state to not have to ...
6 years, 10 months ago (2014-02-06 17:01:10 UTC) #1
Dominik Grewe
On 2014/02/06 17:01:10, reed1 wrote: > Some rough ideas/questions: > > 1. Can we allow ...
6 years, 10 months ago (2014-02-06 17:53:49 UTC) #2
reed1
We use this external storage trick for allocating blitters, which never live longer than a ...
6 years, 10 months ago (2014-02-06 17:55:55 UTC) #3
scroggo
Ignore my comments about SkNEW/SkDELETE once you use the stack allocation trick. Looks like it's ...
6 years, 10 months ago (2014-02-06 17:57:12 UTC) #4
Dominik Grewe
On 2014/02/06 17:55:55, reed1 wrote: > We use this external storage trick for allocating blitters, ...
6 years, 10 months ago (2014-02-06 18:23:08 UTC) #5
Dominik Grewe
Thanks for the feedback! I've updated the patch, so that the SkDrawContext now has all ...
6 years, 10 months ago (2014-02-06 19:00:09 UTC) #6
reed1
On 2014/02/06 18:23:08, Dominik Grewe wrote: > On 2014/02/06 17:55:55, reed1 wrote: > > We ...
6 years, 10 months ago (2014-02-06 19:56:18 UTC) #7
Dominik Grewe
I've added the static allocation. The user is responsible for calling a cleanup() function which ...
6 years, 10 months ago (2014-02-07 11:57:14 UTC) #8
reed1
1. I realize internally we don't do a runtime check of storageSize against sizeof(subclass), but ...
6 years, 10 months ago (2014-02-07 14:46:01 UTC) #9
Dominik Grewe
> 1. I realize internally we don't do a runtime check of storageSize against > ...
6 years, 10 months ago (2014-02-07 16:59:16 UTC) #10
reed1
https://codereview.chromium.org/155513012/diff/270001/include/core/SkDrawLooper.h File include/core/SkDrawLooper.h (right): https://codereview.chromium.org/155513012/diff/270001/include/core/SkDrawLooper.h#newcode60 include/core/SkDrawLooper.h:60: void cleanup(void* storage); Dox?
6 years, 10 months ago (2014-02-07 18:27:40 UTC) #11
Dominik Grewe
https://codereview.chromium.org/155513012/diff/270001/include/core/SkDrawLooper.h File include/core/SkDrawLooper.h (right): https://codereview.chromium.org/155513012/diff/270001/include/core/SkDrawLooper.h#newcode60 include/core/SkDrawLooper.h:60: void cleanup(void* storage); On 2014/02/07 18:27:40, reed1 wrote: > ...
6 years, 10 months ago (2014-02-07 18:42:43 UTC) #12
scroggo
On 2014/02/07 16:59:16, Dominik Grewe wrote: > > 1. I realize internally we don't do ...
6 years, 10 months ago (2014-02-11 15:51:29 UTC) #13
Dominik Grewe
https://codereview.chromium.org/155513012/diff/400001/include/core/SkDrawLooper.h File include/core/SkDrawLooper.h (right): https://codereview.chromium.org/155513012/diff/400001/include/core/SkDrawLooper.h#newcode34 include/core/SkDrawLooper.h:34: * final call to next() will also delete the ...
6 years, 10 months ago (2014-02-11 16:04:30 UTC) #14
scroggo
https://codereview.chromium.org/155513012/diff/400001/src/core/SkTemplatesPriv.h File src/core/SkTemplatesPriv.h (right): https://codereview.chromium.org/155513012/diff/400001/src/core/SkTemplatesPriv.h#newcode25 src/core/SkTemplatesPriv.h:25: result = SkNEW(classname) On 2014/02/11 16:04:31, Dominik Grewe wrote: ...
6 years, 10 months ago (2014-02-11 16:14:26 UTC) #15
bungeman-skia
Hadn't taken a look at SkTemplatesPriv.h before, and didn't realize it was so bad. These ...
6 years, 10 months ago (2014-02-11 17:06:21 UTC) #16
Dominik Grewe
I've added a SK_PLACEMENT_DELETE which makes sure that we correctly destroy the object. I'm happy ...
6 years, 10 months ago (2014-02-11 17:42:33 UTC) #17
Dominik Grewe
I tried to rebase this patch and use Leon's new SkSmallAllocator instead of a raw ...
6 years, 9 months ago (2014-03-10 13:12:17 UTC) #18
scroggo
On 2014/03/10 13:12:17, Dominik Grewe wrote: > I tried to rebase this patch and use ...
6 years, 9 months ago (2014-03-10 15:26:39 UTC) #19
Dominik Grewe
On 2014/03/10 15:26:39, scroggo wrote: > On 2014/03/10 13:12:17, Dominik Grewe wrote: > > I ...
6 years, 9 months ago (2014-03-10 15:49:07 UTC) #20
scroggo
On 2014/03/10 15:49:07, Dominik Grewe wrote: > On 2014/03/10 15:26:39, scroggo wrote: > > On ...
6 years, 9 months ago (2014-03-10 16:10:33 UTC) #21
Dominik Grewe
I've updated the patch to use SkSmallAllocator (now public). I know we said to pause ...
6 years, 9 months ago (2014-03-10 18:52:02 UTC) #22
reed1
If we added a virtual size_t iNeedThisMuchMemory() to SkDrawLooper, perhaps we wouldn't need to expose ...
6 years, 9 months ago (2014-03-10 19:10:15 UTC) #23
scroggo
On 2014/03/10 18:52:02, Dominik Grewe wrote: > I've updated the patch to use SkSmallAllocator (now ...
6 years, 9 months ago (2014-03-10 19:41:31 UTC) #24
Dominik Grewe
I might be missing something here, but a virtual iNeedThisMuchMemory() is obviously dynamic, so how ...
6 years, 9 months ago (2014-03-10 21:54:06 UTC) #25
scroggo
On 2014/03/10 21:54:06, Dominik Grewe wrote: > The whole reason for providing the storage to ...
6 years, 9 months ago (2014-03-10 22:06:30 UTC) #26
Dominik Grewe
Okay, here's the latest version. SkSmallAllocator is private again, but exposes reserveT<>(storageSize). SkDrawLooper::init() expects a ...
6 years, 9 months ago (2014-03-11 11:53:54 UTC) #27
Dominik Grewe
Okay, here's the latest version. SkSmallAllocator is private again, but exposes reserveT<>(storageSize). SkDrawLooper::init() expects a ...
6 years, 9 months ago (2014-03-11 11:53:56 UTC) #28
scroggo
lgtm https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h File include/core/SkDrawLooper.h (right): https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h#newcode34 include/core/SkDrawLooper.h:34: * When the context is no longer needed, ...
6 years, 9 months ago (2014-03-11 14:08:05 UTC) #29
reed1
https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h File include/core/SkDrawLooper.h (right): https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h#newcode69 include/core/SkDrawLooper.h:69: virtual Context* init(SkCanvas*, void* storage) const = 0; Rename ...
6 years, 9 months ago (2014-03-11 14:23:30 UTC) #30
scroggo
https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h File include/core/SkDrawLooper.h (right): https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h#newcode69 include/core/SkDrawLooper.h:69: virtual Context* init(SkCanvas*, void* storage) const = 0; On ...
6 years, 9 months ago (2014-03-11 15:51:01 UTC) #31
reed1
Picture serialization/hardening started to adopt the pattern of passing in explicit buffer sizes... but I'm ...
6 years, 9 months ago (2014-03-11 15:56:30 UTC) #32
sugoi
On 2014/03/11 15:56:30, reed1 wrote: > Picture serialization/hardening started to adopt the pattern of passing ...
6 years, 9 months ago (2014-03-11 16:53:03 UTC) #33
scroggo
On 2014/03/11 16:53:03, sugoi wrote: > On 2014/03/11 15:56:30, reed1 wrote: > > Picture serialization/hardening ...
6 years, 9 months ago (2014-03-11 17:00:02 UTC) #34
Dominik Grewe
Thanks for the feedback. https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h File include/core/SkDrawLooper.h (right): https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h#newcode34 include/core/SkDrawLooper.h:34: * When the context is ...
6 years, 9 months ago (2014-03-11 18:28:16 UTC) #35
scroggo
On 2014/03/11 18:28:16, Dominik Grewe wrote: > Thanks for the feedback. > > https://codereview.chromium.org/155513012/diff/820001/include/core/SkDrawLooper.h > ...
6 years, 9 months ago (2014-03-11 19:03:51 UTC) #36
reed1
lgtm
6 years, 9 months ago (2014-03-11 19:39:13 UTC) #37
Dominik Grewe
The CQ bit was checked by dominikg@chromium.org
6 years, 9 months ago (2014-03-12 09:26:38 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/dominikg@chromium.org/155513012/840001
6 years, 9 months ago (2014-03-12 09:26:44 UTC) #39
commit-bot: I haz the power
6 years, 9 months ago (2014-03-12 09:42:05 UTC) #40
Message was sent while issue was closed.
Change committed as 13760

Powered by Google App Engine
This is Rietveld 408576698