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 29 matching lines...) Expand all Loading... |
40 class GrClipMaskManager : public SkNoncopyable { | 40 class GrClipMaskManager : public SkNoncopyable { |
41 public: | 41 public: |
42 GrClipMaskManager() | 42 GrClipMaskManager() |
43 : fGpu(NULL) | 43 : fGpu(NULL) |
44 , fCurrClipMaskType(kNone_ClipMaskType) { | 44 , fCurrClipMaskType(kNone_ClipMaskType) { |
45 } | 45 } |
46 | 46 |
47 /** | 47 /** |
48 * Creates a clip mask if necessary as a stencil buffer or alpha texture | 48 * Creates a clip mask if necessary as a stencil buffer or alpha texture |
49 * and sets the GrGpu's scissor and stencil state. If the return is false | 49 * and sets the GrGpu's scissor and stencil state. If the return is false |
50 * then the draw can be skipped. | 50 * then the draw can be skipped. The AutoRestoreEffects is initialized by |
| 51 * the manager when it must install additional effects to implement the |
| 52 * clip. devBounds is optional but can help optimize clipping. |
51 */ | 53 */ |
52 bool setupClipping(const GrClipData* clipDataIn, GrDrawState::AutoRestoreEff
ects*); | 54 bool setupClipping(const GrClipData* clipDataIn, GrDrawState::AutoRestoreEff
ects*, |
| 55 const SkRect* devBounds); |
53 | 56 |
54 void releaseResources(); | 57 void releaseResources(); |
55 | 58 |
56 bool isClipInStencil() const { | 59 bool isClipInStencil() const { |
57 return kStencil_ClipMaskType == fCurrClipMaskType; | 60 return kStencil_ClipMaskType == fCurrClipMaskType; |
58 } | 61 } |
59 bool isClipInAlpha() const { | 62 bool isClipInAlpha() const { |
60 return kAlpha_ClipMaskType == fCurrClipMaskType; | 63 return kAlpha_ClipMaskType == fCurrClipMaskType; |
61 } | 64 } |
62 | 65 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 * clipping. | 170 * clipping. |
168 */ | 171 */ |
169 void adjustStencilParams(GrStencilSettings* settings, | 172 void adjustStencilParams(GrStencilSettings* settings, |
170 StencilClipMode mode, | 173 StencilClipMode mode, |
171 int stencilBitCnt); | 174 int stencilBitCnt); |
172 | 175 |
173 typedef SkNoncopyable INHERITED; | 176 typedef SkNoncopyable INHERITED; |
174 }; | 177 }; |
175 | 178 |
176 #endif // GrClipMaskManager_DEFINED | 179 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |