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

Issue 48593003: Avoid re-rendering stencil clip for every draw with reducable clip stack (Closed)

Created:
7 years, 1 month ago by Kimmo Kinnunen
Modified:
7 years, 1 month ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Avoid re-rendering stencil clip for every draw with reducable clip stack Fixes the cases where clip stack reduction would cause clip to be re-rendered to stencil for each draw call. This causes unneeded slowdown. Stencil cache would not be used because the clip stack generation id communicated by the clip stack element list would be invalid. This happended due to a) clip stack reduction creating new elements in the element list. b) purging logic removing the generation id, but reduction logic selecting already purged element, and thus the generation id, as the representative state of the clip. Cases of a) where reduction would flatten the stack to a single new element were fixed by assigning the generation id of the top-most element of the clip stack as the generation id of the new element. This is not strictly minimal, but enables more caching than using invalid id. Cases of a) where reduction would substitute a stack element with a new element the generation id of the substituted element is used. The b) part was fixed by removing the purging logic. It was not exactly correct, as the previously purged states were actually used. The purging was not used for anything. Changes SkClipStack API to highlight that invalid generation id is never returned by SkClipStack. Empty stacks are wide open. Changes the clients to reflect this. Fixes a crash when not passing anti-alias out parameter to GrReducedClip::ReduceClipStack. The crash is not exercised in the current code. Committed: http://code.google.com/p/skia/source/detail?r=12084 Committed: http://code.google.com/p/skia/source/detail?r=12127

Patch Set 1 #

Patch Set 2 : Not changing the way genids are passed #

Patch Set 3 : rebase #

Total comments: 6

Patch Set 4 : addressing comments #

Patch Set 5 : compile fixes #

Patch Set 6 : gcc-4.2 mac os 10.6 fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+257 lines, -147 lines) Patch
M include/core/SkClipStack.h View 1 2 3 3 chunks +4 lines, -34 lines 0 comments Download
M src/core/SkClipStack.cpp View 1 2 3 8 chunks +8 lines, -56 lines 0 comments Download
M src/gpu/GrClipMaskCache.h View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M src/gpu/GrClipMaskManager.h View 1 2 3 2 chunks +5 lines, -4 lines 0 comments Download
M src/gpu/GrClipMaskManager.cpp View 1 2 3 10 chunks +15 lines, -13 lines 0 comments Download
M src/gpu/GrReducedClip.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M src/gpu/GrReducedClip.cpp View 1 2 3 6 chunks +29 lines, -2 lines 0 comments Download
M src/gpu/GrStencilBuffer.h View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M src/gpu/SkGpuDevice.cpp View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M tests/ClipCacheTest.cpp View 1 2 6 chunks +17 lines, -11 lines 0 comments Download
M tests/ClipStackTest.cpp View 1 2 3 4 5 10 chunks +175 lines, -1 line 0 comments Download

Messages

Total messages: 15 (0 generated)
Kimmo Kinnunen
This may be the smallest change? Other option (my preference, maybe) would be to define ...
7 years, 1 month ago (2013-10-28 15:59:56 UTC) #1
bsalomon
Adding Rob as he may have more familiarity with SkClipStack than I do. I believe ...
7 years, 1 month ago (2013-10-28 20:11:05 UTC) #2
Kimmo Kinnunen
On 2013/10/28 20:11:05, bsalomon wrote: > Adding Rob as he may have more familiarity with ...
7 years, 1 month ago (2013-10-29 12:54:30 UTC) #3
bsalomon
On 2013/10/29 12:54:30, kkinnunen wrote: > On 2013/10/28 20:11:05, bsalomon wrote: > > Adding Rob ...
7 years, 1 month ago (2013-10-29 14:33:29 UTC) #4
Kimmo Kinnunen
On 2013/10/29 14:33:29, bsalomon wrote: > On 2013/10/29 12:54:30, kkinnunen wrote: > > Currently SkClipStack ...
7 years, 1 month ago (2013-10-30 08:13:33 UTC) #5
bsalomon
On 2013/10/30 08:13:33, kkinnunen wrote: > On 2013/10/29 14:33:29, bsalomon wrote: > > On 2013/10/29 ...
7 years, 1 month ago (2013-10-30 14:24:09 UTC) #6
bsalomon
https://codereview.chromium.org/48593003/diff/100001/src/core/SkClipStack.cpp File src/core/SkClipStack.cpp (right): https://codereview.chromium.org/48593003/diff/100001/src/core/SkClipStack.cpp#newcode626 src/core/SkClipStack.cpp:626: return getTopmostGenID() == kWideOpenGenID; tiny style nit: this->getTopmostGenID() https://codereview.chromium.org/48593003/diff/100001/src/gpu/GrReducedClip.cpp ...
7 years, 1 month ago (2013-10-30 14:25:58 UTC) #7
Kimmo Kinnunen
https://codereview.chromium.org/48593003/diff/100001/src/core/SkClipStack.cpp File src/core/SkClipStack.cpp (right): https://codereview.chromium.org/48593003/diff/100001/src/core/SkClipStack.cpp#newcode626 src/core/SkClipStack.cpp:626: return getTopmostGenID() == kWideOpenGenID; On 2013/10/30 14:25:59, bsalomon wrote: ...
7 years, 1 month ago (2013-11-01 12:12:19 UTC) #8
bsalomon
lgtm (nice test)
7 years, 1 month ago (2013-11-01 13:09:24 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/kkinnunen@nvidia.com/48593003/180001
7 years, 1 month ago (2013-11-01 13:20:14 UTC) #10
commit-bot: I haz the power
Change committed as 12084
7 years, 1 month ago (2013-11-01 15:24:39 UTC) #11
bsalomon
On 2013/11/01 15:24:39, I haz the power (commit-bot) wrote: > Change committed as 12084 This ...
7 years, 1 month ago (2013-11-01 16:36:39 UTC) #12
Kimmo Kinnunen
On 2013/11/01 16:36:39, bsalomon wrote: > On 2013/11/01 15:24:39, I haz the power (commit-bot) wrote: ...
7 years, 1 month ago (2013-11-04 12:05:15 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/kkinnunen@nvidia.com/48593003/450001
7 years, 1 month ago (2013-11-05 06:16:18 UTC) #14
commit-bot: I haz the power
7 years, 1 month ago (2013-11-05 15:03:15 UTC) #15
Message was sent while issue was closed.
Change committed as 12127

Powered by Google App Engine
This is Rietveld 408576698