OLD | NEW |
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 Loading... |
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 fLastClipStackGenID != clipStackGenID || | 46 return SkClipStack::kInvalidGenID == clipStackGenID || |
| 47 fLastClipStackGenID != clipStackGenID || |
47 fLastClipSpaceOffset != clipSpaceToStencilOffset || | 48 fLastClipSpaceOffset != clipSpaceToStencilOffset || |
48 !fLastClipStackRect.contains(clipSpaceRect); | 49 !fLastClipStackRect.contains(clipSpaceRect); |
49 } | 50 } |
50 | 51 |
51 // Places the sb in the cache. The cache takes a ref of the stencil buffer. | 52 // Places the sb in the cache. The cache takes a ref of the stencil buffer. |
52 void transferToCache(); | 53 void transferToCache(); |
53 | 54 |
54 static GrResourceKey ComputeKey(int width, int height, int sampleCnt); | 55 static GrResourceKey ComputeKey(int width, int height, int sampleCnt); |
55 | 56 |
56 protected: | 57 protected: |
(...skipping 15 matching lines...) Expand all Loading... |
72 int fSampleCnt; | 73 int fSampleCnt; |
73 | 74 |
74 int32_t fLastClipStackGenID; | 75 int32_t fLastClipStackGenID; |
75 SkIRect fLastClipStackRect; | 76 SkIRect fLastClipStackRect; |
76 SkIPoint fLastClipSpaceOffset; | 77 SkIPoint fLastClipSpaceOffset; |
77 | 78 |
78 typedef GrResource INHERITED; | 79 typedef GrResource INHERITED; |
79 }; | 80 }; |
80 | 81 |
81 #endif | 82 #endif |
OLD | NEW |