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

Side by Side Diff: src/gpu/GrClipMaskCache.h

Issue 48593003: Avoid re-rendering stencil clip for every draw with reducable clip stack (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: gcc-4.2 mac os 10.6 fix Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/core/SkClipStack.cpp ('k') | src/gpu/GrClipMaskManager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrClipMaskCache_DEFINED 8 #ifndef GrClipMaskCache_DEFINED
9 #define GrClipMaskCache_DEFINED 9 #define GrClipMaskCache_DEFINED
10 10
(...skipping 18 matching lines...) Expand all
29 temp->~GrClipStackFrame(); 29 temp->~GrClipStackFrame();
30 fStack.pop_back(); 30 fStack.pop_back();
31 } 31 }
32 } 32 }
33 33
34 bool canReuse(int32_t clipGenID, const SkIRect& bounds) { 34 bool canReuse(int32_t clipGenID, const SkIRect& bounds) {
35 35
36 SkASSERT(clipGenID != SkClipStack::kWideOpenGenID); 36 SkASSERT(clipGenID != SkClipStack::kWideOpenGenID);
37 SkASSERT(clipGenID != SkClipStack::kEmptyGenID); 37 SkASSERT(clipGenID != SkClipStack::kEmptyGenID);
38 38
39 if (SkClipStack::kInvalidGenID == clipGenID) {
40 return false;
41 }
42
43 GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); 39 GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
44 40
45 // We could reuse the mask if bounds is a subset of last bounds. We'd ha ve to communicate 41 // We could reuse the mask if bounds is a subset of last bounds. We'd ha ve to communicate
46 // an offset to the caller. 42 // an offset to the caller.
47 if (back->fLastMask.texture() && 43 if (back->fLastMask.texture() &&
48 back->fLastBound == bounds && 44 back->fLastBound == bounds &&
49 back->fLastClipGenID == clipGenID) { 45 back->fLastClipGenID == clipGenID) {
50 return true; 46 return true;
51 } 47 }
52 48
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 SkIRect fLastBound; 226 SkIRect fLastBound;
231 }; 227 };
232 228
233 GrContext* fContext; 229 GrContext* fContext;
234 SkDeque fStack; 230 SkDeque fStack;
235 231
236 typedef SkNoncopyable INHERITED; 232 typedef SkNoncopyable INHERITED;
237 }; 233 };
238 234
239 #endif // GrClipMaskCache_DEFINED 235 #endif // GrClipMaskCache_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkClipStack.cpp ('k') | src/gpu/GrClipMaskManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698