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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 , fCurrClipMaskType(kNone_ClipMaskType) { | 43 , fCurrClipMaskType(kNone_ClipMaskType) { |
44 } | 44 } |
45 | 45 |
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, | 53 bool setupClipping(const GrClipData* clipDataIn, GrDrawState::AutoRestoreEff
ects*, |
54 GrDrawState::AutoRestoreEffects*, | |
55 GrDrawState::AutoRestoreStencil*, | |
56 const SkRect* devBounds); | 54 const SkRect* devBounds); |
57 | 55 |
58 /** | 56 /** |
59 * Purge resources to free up memory. TODO: This class shouldn't hold any lo
ng lived refs | 57 * Purge resources to free up memory. TODO: This class shouldn't hold any lo
ng lived refs |
60 * which will allow ResourceCache2 to automatically purge anything this clas
s has created. | 58 * which will allow ResourceCache2 to automatically purge anything this clas
s has created. |
61 */ | 59 */ |
62 void purgeResources(); | 60 void purgeResources(); |
63 | 61 |
64 bool isClipInStencil() const { | 62 bool isClipInStencil() const { |
65 return kStencil_ClipMaskType == fCurrClipMaskType; | 63 return kStencil_ClipMaskType == fCurrClipMaskType; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 GrTexture* createTempMask(int width, int height); | 166 GrTexture* createTempMask(int width, int height); |
169 | 167 |
170 void setupCache(const SkClipStack& clip, | 168 void setupCache(const SkClipStack& clip, |
171 const SkIRect& bounds); | 169 const SkIRect& bounds); |
172 | 170 |
173 /** | 171 /** |
174 * Called prior to return control back the GrGpu in setupClipping. It | 172 * Called prior to return control back the GrGpu in setupClipping. It |
175 * updates the GrGpu with stencil settings that account stencil-based | 173 * updates the GrGpu with stencil settings that account stencil-based |
176 * clipping. | 174 * clipping. |
177 */ | 175 */ |
178 void setDrawStateStencil(GrDrawState::AutoRestoreStencil* asr); | 176 void setGpuStencil(); |
179 | 177 |
180 /** | 178 /** |
181 * Adjusts the stencil settings to account for interaction with stencil | 179 * Adjusts the stencil settings to account for interaction with stencil |
182 * clipping. | 180 * clipping. |
183 */ | 181 */ |
184 void adjustStencilParams(GrStencilSettings* settings, | 182 void adjustStencilParams(GrStencilSettings* settings, |
185 StencilClipMode mode, | 183 StencilClipMode mode, |
186 int stencilBitCnt); | 184 int stencilBitCnt); |
187 | 185 |
188 typedef SkNoncopyable INHERITED; | 186 typedef SkNoncopyable INHERITED; |
189 }; | 187 }; |
190 | 188 |
191 #endif // GrClipMaskManager_DEFINED | 189 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |