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

Side by Side Diff: src/gpu/GrStencilBuffer.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/gpu/GrReducedClip.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef GrStencilBuffer_DEFINED 10 #ifndef GrStencilBuffer_DEFINED
(...skipping 25 matching lines...) Expand all
36 const SkIPoint clipSpaceToStencilOffset) { 36 const SkIPoint clipSpaceToStencilOffset) {
37 fLastClipStackGenID = clipStackGenID; 37 fLastClipStackGenID = clipStackGenID;
38 fLastClipStackRect = clipSpaceRect; 38 fLastClipStackRect = clipSpaceRect;
39 fLastClipSpaceOffset = clipSpaceToStencilOffset; 39 fLastClipSpaceOffset = clipSpaceToStencilOffset;
40 } 40 }
41 41
42 // called to determine if we have to render the clip into SB. 42 // called to determine if we have to render the clip into SB.
43 bool mustRenderClip(int32_t clipStackGenID, 43 bool mustRenderClip(int32_t clipStackGenID,
44 const SkIRect& clipSpaceRect, 44 const SkIRect& clipSpaceRect,
45 const SkIPoint clipSpaceToStencilOffset) const { 45 const SkIPoint clipSpaceToStencilOffset) const {
46 return SkClipStack::kInvalidGenID == clipStackGenID || 46 return fLastClipStackGenID != clipStackGenID ||
47 fLastClipStackGenID != clipStackGenID ||
48 fLastClipSpaceOffset != clipSpaceToStencilOffset || 47 fLastClipSpaceOffset != clipSpaceToStencilOffset ||
49 !fLastClipStackRect.contains(clipSpaceRect); 48 !fLastClipStackRect.contains(clipSpaceRect);
50 } 49 }
51 50
52 // Places the sb in the cache. The cache takes a ref of the stencil buffer. 51 // Places the sb in the cache. The cache takes a ref of the stencil buffer.
53 void transferToCache(); 52 void transferToCache();
54 53
55 static GrResourceKey ComputeKey(int width, int height, int sampleCnt); 54 static GrResourceKey ComputeKey(int width, int height, int sampleCnt);
56 55
57 protected: 56 protected:
(...skipping 15 matching lines...) Expand all
73 int fSampleCnt; 72 int fSampleCnt;
74 73
75 int32_t fLastClipStackGenID; 74 int32_t fLastClipStackGenID;
76 SkIRect fLastClipStackRect; 75 SkIRect fLastClipStackRect;
77 SkIPoint fLastClipSpaceOffset; 76 SkIPoint fLastClipSpaceOffset;
78 77
79 typedef GrResource INHERITED; 78 typedef GrResource INHERITED;
80 }; 79 };
81 80
82 #endif 81 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrReducedClip.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698