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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 */ | 96 */ |
97 enum ClipMaskType { | 97 enum ClipMaskType { |
98 kNone_ClipMaskType, | 98 kNone_ClipMaskType, |
99 kStencil_ClipMaskType, | 99 kStencil_ClipMaskType, |
100 kAlpha_ClipMaskType, | 100 kAlpha_ClipMaskType, |
101 } fCurrClipMaskType; | 101 } fCurrClipMaskType; |
102 | 102 |
103 GrClipMaskCache fAACache; // cache for the AA path | 103 GrClipMaskCache fAACache; // cache for the AA path |
104 | 104 |
105 // Draws the clip into the stencil buffer | 105 // Draws the clip into the stencil buffer |
106 bool createStencilClipMask(int32_t elementsGenID, | 106 bool createStencilClipMask(GrReducedClip::InitialState initialState, |
107 GrReducedClip::InitialState initialState, | |
108 const GrReducedClip::ElementList& elements, | 107 const GrReducedClip::ElementList& elements, |
109 const SkIRect& clipSpaceIBounds, | 108 const SkIRect& clipSpaceIBounds, |
110 const SkIPoint& clipSpaceToStencilOffset); | 109 const SkIPoint& clipSpaceToStencilOffset); |
111 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the | 110 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the |
112 // rect specified by clipSpaceIBounds. | 111 // rect specified by clipSpaceIBounds. |
113 GrTexture* createAlphaClipMask(int32_t elementsGenID, | 112 GrTexture* createAlphaClipMask(int32_t clipStackGenID, |
114 GrReducedClip::InitialState initialState, | 113 GrReducedClip::InitialState initialState, |
115 const GrReducedClip::ElementList& elements, | 114 const GrReducedClip::ElementList& elements, |
116 const SkIRect& clipSpaceIBounds); | 115 const SkIRect& clipSpaceIBounds); |
117 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the
result texture. | 116 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the
result texture. |
118 GrTexture* createSoftwareClipMask(int32_t elementsGenID, | 117 GrTexture* createSoftwareClipMask(int32_t clipStackGenID, |
119 GrReducedClip::InitialState initialState, | 118 GrReducedClip::InitialState initialState, |
120 const GrReducedClip::ElementList& elements
, | 119 const GrReducedClip::ElementList& elements
, |
121 const SkIRect& clipSpaceIBounds); | 120 const SkIRect& clipSpaceIBounds); |
122 | 121 |
123 // Gets a texture to use for the clip mask. If true is returned then a cache
d mask was found | 122 // Gets a texture to use for the clip mask. If true is returned then a cache
d mask was found |
124 // that already contains the rasterization of the clip stack, otherwise an u
ninitialized texture | 123 // that already contains the rasterization of the clip stack, otherwise an u
ninitialized texture |
125 // is returned. 'willUpload' is set when the alpha mask needs to be uploaded
from the CPU. | 124 // is returned. 'willUpload' is set when the alpha mask needs to be uploaded
from the CPU. |
126 bool getMaskTexture(int32_t elementsGenID, | 125 bool getMaskTexture(int32_t clipStackGenID, |
127 const SkIRect& clipSpaceIBounds, | 126 const SkIRect& clipSpaceIBounds, |
128 GrTexture** result, | 127 GrTexture** result, |
129 bool willUpload); | 128 bool willUpload); |
130 | 129 |
131 bool useSWOnlyPath(const GrReducedClip::ElementList& elements); | 130 bool useSWOnlyPath(const GrReducedClip::ElementList& elements); |
132 | 131 |
133 // Draws a clip element into the target alpha mask. The caller should have a
lready setup the | 132 // Draws a clip element into the target alpha mask. The caller should have a
lready setup the |
134 // desired blend operation. Optionally if the caller already selected a path
renderer it can | 133 // desired blend operation. Optionally if the caller already selected a path
renderer it can |
135 // be passed. Otherwise the function will select one if the element is a pat
h. | 134 // be passed. Otherwise the function will select one if the element is a pat
h. |
136 bool drawElement(GrTexture* target, const SkClipStack::Element*, GrPathRende
rer* = NULL); | 135 bool drawElement(GrTexture* target, const SkClipStack::Element*, GrPathRende
rer* = NULL); |
(...skipping 26 matching lines...) Expand all Loading... |
163 * clipping. | 162 * clipping. |
164 */ | 163 */ |
165 void adjustStencilParams(GrStencilSettings* settings, | 164 void adjustStencilParams(GrStencilSettings* settings, |
166 StencilClipMode mode, | 165 StencilClipMode mode, |
167 int stencilBitCnt); | 166 int stencilBitCnt); |
168 | 167 |
169 typedef SkNoncopyable INHERITED; | 168 typedef SkNoncopyable INHERITED; |
170 }; | 169 }; |
171 | 170 |
172 #endif // GrClipMaskManager_DEFINED | 171 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |