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

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

Issue 54543008: Revert "Avoid re-rendering stencil clip for every draw with reducable clip stack" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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
39 GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); 43 GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
40 44
41 // We could reuse the mask if bounds is a subset of last bounds. We'd ha ve to communicate 45 // We could reuse the mask if bounds is a subset of last bounds. We'd ha ve to communicate
42 // an offset to the caller. 46 // an offset to the caller.
43 if (back->fLastMask.texture() && 47 if (back->fLastMask.texture() &&
44 back->fLastBound == bounds && 48 back->fLastBound == bounds &&
45 back->fLastClipGenID == clipGenID) { 49 back->fLastClipGenID == clipGenID) {
46 return true; 50 return true;
47 } 51 }
48 52
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 SkIRect fLastBound; 230 SkIRect fLastBound;
227 }; 231 };
228 232
229 GrContext* fContext; 233 GrContext* fContext;
230 SkDeque fStack; 234 SkDeque fStack;
231 235
232 typedef SkNoncopyable INHERITED; 236 typedef SkNoncopyable INHERITED;
233 }; 237 };
234 238
235 #endif // GrClipMaskCache_DEFINED 239 #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