| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 #ifndef GrClipMaskManager_DEFINED | 9 #ifndef GrClipMaskManager_DEFINED |
| 10 #define GrClipMaskManager_DEFINED | 10 #define GrClipMaskManager_DEFINED |
| 11 | 11 |
| 12 #include "GrContext.h" | 12 #include "GrContext.h" |
| 13 #include "GrDrawState.h" |
| 13 #include "GrNoncopyable.h" | 14 #include "GrNoncopyable.h" |
| 14 #include "GrRect.h" | 15 #include "GrRect.h" |
| 15 #include "GrReducedClip.h" | 16 #include "GrReducedClip.h" |
| 16 #include "GrStencil.h" | 17 #include "GrStencil.h" |
| 17 #include "GrTexture.h" | 18 #include "GrTexture.h" |
| 18 | 19 |
| 19 #include "SkClipStack.h" | 20 #include "SkClipStack.h" |
| 20 #include "SkDeque.h" | 21 #include "SkDeque.h" |
| 21 #include "SkPath.h" | 22 #include "SkPath.h" |
| 22 #include "SkRefCnt.h" | 23 #include "SkRefCnt.h" |
| 23 #include "SkTLList.h" | 24 #include "SkTLList.h" |
| 24 | 25 |
| 25 #include "GrClipMaskCache.h" | 26 #include "GrClipMaskCache.h" |
| 26 | 27 |
| 27 class GrGpu; | 28 class GrGpu; |
| 28 class GrPathRenderer; | 29 class GrPathRenderer; |
| 29 class GrPathRendererChain; | 30 class GrPathRendererChain; |
| 30 class SkPath; | 31 class SkPath; |
| 31 class GrTexture; | 32 class GrTexture; |
| 32 class GrDrawState; | |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * The clip mask creator handles the generation of the clip mask. If anti | 35 * The clip mask creator handles the generation of the clip mask. If anti |
| 36 * aliasing is requested it will (in the future) generate a single channel | 36 * aliasing is requested it will (in the future) generate a single channel |
| 37 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit | 37 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit |
| 38 * mask in the stencil buffer. In the non anti-aliasing case, if the clip | 38 * mask in the stencil buffer. In the non anti-aliasing case, if the clip |
| 39 * mask can be represented as a rectangle then scissoring is used. In all | 39 * mask can be represented as a rectangle then scissoring is used. In all |
| 40 * cases scissoring is used to bound the range of the clip mask. | 40 * cases scissoring is used to bound the range of the clip mask. |
| 41 */ | 41 */ |
| 42 class GrClipMaskManager : public GrNoncopyable { | 42 class GrClipMaskManager : public GrNoncopyable { |
| 43 public: | 43 public: |
| 44 GrClipMaskManager() | 44 GrClipMaskManager() |
| 45 : fGpu(NULL) | 45 : fGpu(NULL) |
| 46 , fCurrClipMaskType(kNone_ClipMaskType) { | 46 , fCurrClipMaskType(kNone_ClipMaskType) { |
| 47 } | 47 } |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * Creates a clip mask if necessary as a stencil buffer or alpha texture | 50 * Creates a clip mask if necessary as a stencil buffer or alpha texture |
| 51 * and sets the GrGpu's scissor and stencil state. If the return is false | 51 * and sets the GrGpu's scissor and stencil state. If the return is false |
| 52 * then the draw can be skipped. | 52 * then the draw can be skipped. |
| 53 */ | 53 */ |
| 54 bool setupClipping(const GrClipData* clipDataIn); | 54 bool setupClipping(const GrClipData* clipDataIn, GrDrawState::AutoRestoreEff
ects*); |
| 55 | 55 |
| 56 void releaseResources(); | 56 void releaseResources(); |
| 57 | 57 |
| 58 bool isClipInStencil() const { | 58 bool isClipInStencil() const { |
| 59 return kStencil_ClipMaskType == fCurrClipMaskType; | 59 return kStencil_ClipMaskType == fCurrClipMaskType; |
| 60 } | 60 } |
| 61 bool isClipInAlpha() const { | 61 bool isClipInAlpha() const { |
| 62 return kAlpha_ClipMaskType == fCurrClipMaskType; | 62 return kAlpha_ClipMaskType == fCurrClipMaskType; |
| 63 } | 63 } |
| 64 | 64 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 * clipping. | 162 * clipping. |
| 163 */ | 163 */ |
| 164 void adjustStencilParams(GrStencilSettings* settings, | 164 void adjustStencilParams(GrStencilSettings* settings, |
| 165 StencilClipMode mode, | 165 StencilClipMode mode, |
| 166 int stencilBitCnt); | 166 int stencilBitCnt); |
| 167 | 167 |
| 168 typedef GrNoncopyable INHERITED; | 168 typedef GrNoncopyable INHERITED; |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 #endif // GrClipMaskManager_DEFINED | 171 #endif // GrClipMaskManager_DEFINED |
| OLD | NEW |