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 #ifndef GrClipMaskManager_DEFINED | 7 #ifndef GrClipMaskManager_DEFINED |
8 #define GrClipMaskManager_DEFINED | 8 #define GrClipMaskManager_DEFINED |
9 | 9 |
10 #include "GrPipelineBuilder.h" | 10 #include "GrPipelineBuilder.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 /** | 48 /** |
49 * The clip mask creator handles the generation of the clip mask. If anti | 49 * The clip mask creator handles the generation of the clip mask. If anti |
50 * aliasing is requested it will (in the future) generate a single channel | 50 * aliasing is requested it will (in the future) generate a single channel |
51 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit | 51 * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit |
52 * mask in the stencil buffer. In the non anti-aliasing case, if the clip | 52 * mask in the stencil buffer. In the non anti-aliasing case, if the clip |
53 * mask can be represented as a rectangle then scissoring is used. In all | 53 * mask can be represented as a rectangle then scissoring is used. In all |
54 * cases scissoring is used to bound the range of the clip mask. | 54 * cases scissoring is used to bound the range of the clip mask. |
55 */ | 55 */ |
56 class GrClipMaskManager : SkNoncopyable { | 56 class GrClipMaskManager : SkNoncopyable { |
57 public: | 57 public: |
58 GrClipMaskManager(GrDrawTarget* owner); | 58 GrClipMaskManager(GrDrawTarget* owner, bool debugClipBatchToBounds); |
59 | 59 |
60 /** | 60 /** |
61 * Creates a clip mask if necessary as a stencil buffer or alpha texture | 61 * Creates a clip mask if necessary as a stencil buffer or alpha texture |
62 * and sets the GrGpu's scissor and stencil state. If the return is false | 62 * and sets the GrGpu's scissor and stencil state. If the return is false |
63 * then the draw can be skipped. The AutoRestoreEffects is initialized by | 63 * then the draw can be skipped. The AutoRestoreEffects is initialized by |
64 * the manager when it must install additional effects to implement the | 64 * the manager when it must install additional effects to implement the |
65 * clip. devBounds is optional but can help optimize clipping. | 65 * clip. devBounds is optional but can help optimize clipping. |
66 */ | 66 */ |
67 bool setupClipping(const GrPipelineBuilder&, | 67 bool setupClipping(const GrPipelineBuilder&, |
68 GrPipelineBuilder::AutoRestoreStencil*, | 68 GrPipelineBuilder::AutoRestoreStencil*, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); | 168 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); |
169 | 169 |
170 static const int kMaxAnalyticElements = 4; | 170 static const int kMaxAnalyticElements = 4; |
171 | 171 |
172 GrDrawTarget* fDrawTarget; // This is our owning draw target. | 172 GrDrawTarget* fDrawTarget; // This is our owning draw target. |
173 StencilClipMode fClipMode; | 173 StencilClipMode fClipMode; |
| 174 bool fDebugClipBatchToBounds; |
174 | 175 |
175 typedef SkNoncopyable INHERITED; | 176 typedef SkNoncopyable INHERITED; |
176 }; | 177 }; |
177 #endif // GrClipMaskManager_DEFINED | 178 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |