| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 #ifndef GrClipMaskManager_DEFINED | 8 #ifndef GrClipMaskManager_DEFINED |
| 10 #define GrClipMaskManager_DEFINED | 9 #define GrClipMaskManager_DEFINED |
| 11 | 10 |
| 11 #include "GrClipMaskCache.h" |
| 12 #include "GrContext.h" | 12 #include "GrContext.h" |
| 13 #include "GrDrawState.h" | 13 #include "GrDrawState.h" |
| 14 #include "GrNoncopyable.h" | |
| 15 #include "GrReducedClip.h" | 14 #include "GrReducedClip.h" |
| 16 #include "GrStencil.h" | 15 #include "GrStencil.h" |
| 17 #include "GrTexture.h" | 16 #include "GrTexture.h" |
| 18 | 17 |
| 19 #include "SkClipStack.h" | 18 #include "SkClipStack.h" |
| 20 #include "SkDeque.h" | 19 #include "SkDeque.h" |
| 21 #include "SkPath.h" | 20 #include "SkPath.h" |
| 22 #include "SkRefCnt.h" | 21 #include "SkRefCnt.h" |
| 23 #include "SkTLList.h" | 22 #include "SkTLList.h" |
| 24 | 23 #include "SkTypes.h" |
| 25 #include "GrClipMaskCache.h" | |
| 26 | 24 |
| 27 class GrGpu; | 25 class GrGpu; |
| 28 class GrPathRenderer; | 26 class GrPathRenderer; |
| 29 class GrPathRendererChain; | 27 class GrPathRendererChain; |
| 28 class GrTexture; |
| 30 class SkPath; | 29 class SkPath; |
| 31 class GrTexture; | |
| 32 | 30 |
| 33 /** | 31 /** |
| 34 * The clip mask creator handles the generation of the clip mask. If anti | 32 * The clip mask creator handles the generation of the clip mask. If anti |
| 35 * aliasing is requested it will (in the future) generate a single channel | 33 * aliasing is requested it will (in the future) generate a single channel |
| 36 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit | 34 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit |
| 37 * mask in the stencil buffer. In the non anti-aliasing case, if the clip | 35 * mask in the stencil buffer. In the non anti-aliasing case, if the clip |
| 38 * mask can be represented as a rectangle then scissoring is used. In all | 36 * mask can be represented as a rectangle then scissoring is used. In all |
| 39 * cases scissoring is used to bound the range of the clip mask. | 37 * cases scissoring is used to bound the range of the clip mask. |
| 40 */ | 38 */ |
| 41 class GrClipMaskManager : public GrNoncopyable { | 39 class GrClipMaskManager : public SkNoncopyable { |
| 42 public: | 40 public: |
| 43 GrClipMaskManager() | 41 GrClipMaskManager() |
| 44 : fGpu(NULL) | 42 : fGpu(NULL) |
| 45 , fCurrClipMaskType(kNone_ClipMaskType) { | 43 , fCurrClipMaskType(kNone_ClipMaskType) { |
| 46 } | 44 } |
| 47 | 45 |
| 48 /** | 46 /** |
| 49 * 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 |
| 50 * 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 |
| 51 * then the draw can be skipped. | 49 * then the draw can be skipped. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void setGpuStencil(); | 155 void setGpuStencil(); |
| 158 | 156 |
| 159 /** | 157 /** |
| 160 * Adjusts the stencil settings to account for interaction with stencil | 158 * Adjusts the stencil settings to account for interaction with stencil |
| 161 * clipping. | 159 * clipping. |
| 162 */ | 160 */ |
| 163 void adjustStencilParams(GrStencilSettings* settings, | 161 void adjustStencilParams(GrStencilSettings* settings, |
| 164 StencilClipMode mode, | 162 StencilClipMode mode, |
| 165 int stencilBitCnt); | 163 int stencilBitCnt); |
| 166 | 164 |
| 167 typedef GrNoncopyable INHERITED; | 165 typedef SkNoncopyable INHERITED; |
| 168 }; | 166 }; |
| 169 | 167 |
| 170 #endif // GrClipMaskManager_DEFINED | 168 #endif // GrClipMaskManager_DEFINED |
| OLD | NEW |