OLD | NEW |
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 GrClipMaskManager_DEFINED | 8 #ifndef GrClipMaskManager_DEFINED |
9 #define GrClipMaskManager_DEFINED | 9 #define GrClipMaskManager_DEFINED |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 /** | 46 /** |
47 * Creates a clip mask if necessary as a stencil buffer or alpha texture | 47 * Creates a clip mask if necessary as a stencil buffer or alpha texture |
48 * and sets the GrGpu's scissor and stencil state. If the return is false | 48 * and sets the GrGpu's scissor and stencil state. If the return is false |
49 * then the draw can be skipped. The AutoRestoreEffects is initialized by | 49 * then the draw can be skipped. The AutoRestoreEffects is initialized by |
50 * the manager when it must install additional effects to implement the | 50 * the manager when it must install additional effects to implement the |
51 * clip. devBounds is optional but can help optimize clipping. | 51 * clip. devBounds is optional but can help optimize clipping. |
52 */ | 52 */ |
53 bool setupClipping(const GrClipData* clipDataIn, GrDrawState::AutoRestoreEff
ects*, | 53 bool setupClipping(const GrClipData* clipDataIn, GrDrawState::AutoRestoreEff
ects*, |
54 const SkRect* devBounds); | 54 const SkRect* devBounds); |
55 | 55 |
56 /** | 56 void releaseResources(); |
57 * Purge resources to free up memory. TODO: This class shouldn't hold any lo
ng lived refs | |
58 * which will allow ResourceCache2 to automatically purge anything this clas
s has created. | |
59 */ | |
60 void purgeResources(); | |
61 | 57 |
62 bool isClipInStencil() const { | 58 bool isClipInStencil() const { |
63 return kStencil_ClipMaskType == fCurrClipMaskType; | 59 return kStencil_ClipMaskType == fCurrClipMaskType; |
64 } | 60 } |
65 bool isClipInAlpha() const { | 61 bool isClipInAlpha() const { |
66 return kAlpha_ClipMaskType == fCurrClipMaskType; | 62 return kAlpha_ClipMaskType == fCurrClipMaskType; |
67 } | 63 } |
68 | 64 |
69 void invalidateStencilMask() { | 65 void invalidateStencilMask() { |
70 if (kStencil_ClipMaskType == fCurrClipMaskType) { | 66 if (kStencil_ClipMaskType == fCurrClipMaskType) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 * clipping. | 176 * clipping. |
181 */ | 177 */ |
182 void adjustStencilParams(GrStencilSettings* settings, | 178 void adjustStencilParams(GrStencilSettings* settings, |
183 StencilClipMode mode, | 179 StencilClipMode mode, |
184 int stencilBitCnt); | 180 int stencilBitCnt); |
185 | 181 |
186 typedef SkNoncopyable INHERITED; | 182 typedef SkNoncopyable INHERITED; |
187 }; | 183 }; |
188 | 184 |
189 #endif // GrClipMaskManager_DEFINED | 185 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |