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