| 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 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 Loading... |
| 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 |
| OLD | NEW |