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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Draw to the clip bit of the stencil buffer | 80 // Draw to the clip bit of the stencil buffer |
81 kModifyClip_StencilClipMode, | 81 kModifyClip_StencilClipMode, |
82 // Clip against the existing representation of the clip in the high bit | 82 // Clip against the existing representation of the clip in the high bit |
83 // of the stencil buffer. | 83 // of the stencil buffer. |
84 kRespectClip_StencilClipMode, | 84 kRespectClip_StencilClipMode, |
85 // Neither writing to nor clipping against the clip bit. | 85 // Neither writing to nor clipping against the clip bit. |
86 kIgnoreClip_StencilClipMode, | 86 kIgnoreClip_StencilClipMode, |
87 }; | 87 }; |
88 | 88 |
89 // Attempts to install a series of coverage effects to implement the clip. R
eturn indicates | 89 // Attempts to install a series of coverage effects to implement the clip. R
eturn indicates |
90 // whether the element list was successfully converted to effects. | 90 // whether the element list was successfully converted to processors. *fp ma
y be nullptr even |
91 const GrFragmentProcessor* getAnalyticClipProcessor(const GrReducedClip::Ele
mentList&, | 91 // when the function succeeds because all the elements were ignored. TODO: M
ake clip reduction |
92 const SkVector& clipOffs
et, | 92 // bounds-aware and stop checking bounds in this function. |
93 const SkRect* devBounds)
; | 93 bool getAnalyticClipProcessor(const GrReducedClip::ElementList&, |
| 94 SkVector& clipOffset, |
| 95 const SkRect* devBounds, |
| 96 const GrFragmentProcessor** fp); |
94 | 97 |
95 // Draws the clip into the stencil buffer | 98 // Draws the clip into the stencil buffer |
96 bool createStencilClipMask(GrRenderTarget*, | 99 bool createStencilClipMask(GrRenderTarget*, |
97 int32_t elementsGenID, | 100 int32_t elementsGenID, |
98 GrReducedClip::InitialState initialState, | 101 GrReducedClip::InitialState initialState, |
99 const GrReducedClip::ElementList& elements, | 102 const GrReducedClip::ElementList& elements, |
100 const SkIRect& clipSpaceIBounds, | 103 const SkIRect& clipSpaceIBounds, |
101 const SkIPoint& clipSpaceToStencilOffset); | 104 const SkIPoint& clipSpaceToStencilOffset); |
102 | 105 |
103 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the | 106 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); | 166 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); |
164 | 167 |
165 static const int kMaxAnalyticElements = 4; | 168 static const int kMaxAnalyticElements = 4; |
166 | 169 |
167 GrDrawTarget* fDrawTarget; // This is our owning draw target. | 170 GrDrawTarget* fDrawTarget; // This is our owning draw target. |
168 StencilClipMode fClipMode; | 171 StencilClipMode fClipMode; |
169 | 172 |
170 typedef SkNoncopyable INHERITED; | 173 typedef SkNoncopyable INHERITED; |
171 }; | 174 }; |
172 #endif // GrClipMaskManager_DEFINED | 175 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |