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 |
11 #include "GrClipMaskCache.h" | 11 #include "GrClipMaskCache.h" |
12 #include "GrContext.h" | 12 #include "GrContext.h" |
13 #include "GrDrawState.h" | 13 #include "GrDrawState.h" |
14 #include "GrPathRenderer.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 #include "SkTypes.h" | 23 #include "SkTypes.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // Gets a texture to use for the clip mask. If true is returned then a cache
d mask was found | 123 // Gets a texture to use for the clip mask. If true is returned then a cache
d mask was found |
125 // that already contains the rasterization of the clip stack, otherwise an u
ninitialized texture | 124 // that already contains the rasterization of the clip stack, otherwise an u
ninitialized texture |
126 // is returned. 'willUpload' is set when the alpha mask needs to be uploaded
from the CPU. | 125 // is returned. 'willUpload' is set when the alpha mask needs to be uploaded
from the CPU. |
127 bool getMaskTexture(int32_t elementsGenID, | 126 bool getMaskTexture(int32_t elementsGenID, |
128 const SkIRect& clipSpaceIBounds, | 127 const SkIRect& clipSpaceIBounds, |
129 GrTexture** result, | 128 GrTexture** result, |
130 bool willUpload); | 129 bool willUpload); |
131 | 130 |
132 bool useSWOnlyPath(const GrReducedClip::ElementList& elements); | 131 bool useSWOnlyPath(const GrReducedClip::ElementList& elements); |
133 | 132 |
134 // Draws a filled clip path into the target alpha mask | |
135 bool drawFilledPath(GrTexture* target, GrPathRenderer* pathRenderer, bool is
AA); | |
136 | |
137 // Draws a clip element into the target alpha mask. The caller should have a
lready setup the | 133 // Draws a clip element into the target alpha mask. The caller should have a
lready setup the |
138 // desired blend operation. | 134 // desired blend operation. Optionally if the caller already selected a path
renderer it can |
139 bool drawElement(GrTexture* target, const SkClipStack::Element* element); | 135 // 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); |
140 | 137 |
141 // Determines whether it is possible to draw the element to both the stencil
buffer and the | 138 // Determines whether it is possible to draw the element to both the stencil
buffer and the |
142 // alpha mask simultaneously. If so and the element is a path a compatible p
ath renderer is | 139 // alpha mask simultaneously. If so and the element is a path a compatible p
ath renderer is |
143 // also returned. | 140 // also returned. |
144 bool canStencilAndDrawElement(GrTexture* target, const SkClipStack::Element*
, | 141 bool canStencilAndDrawElement(GrTexture* target, const SkClipStack::Element*
, GrPathRenderer**); |
145 GrPathRenderer::AutoClearPath* pr); | |
146 | 142 |
147 void mergeMask(GrTexture* dstMask, | 143 void mergeMask(GrTexture* dstMask, |
148 GrTexture* srcMask, | 144 GrTexture* srcMask, |
149 SkRegion::Op op, | 145 SkRegion::Op op, |
150 const SkIRect& dstBound, | 146 const SkIRect& dstBound, |
151 const SkIRect& srcBound); | 147 const SkIRect& srcBound); |
152 | 148 |
153 void getTemp(int width, int height, GrAutoScratchTexture* temp); | 149 void getTemp(int width, int height, GrAutoScratchTexture* temp); |
154 | 150 |
155 void setupCache(const SkClipStack& clip, | 151 void setupCache(const SkClipStack& clip, |
(...skipping 11 matching lines...) Expand all Loading... |
167 * clipping. | 163 * clipping. |
168 */ | 164 */ |
169 void adjustStencilParams(GrStencilSettings* settings, | 165 void adjustStencilParams(GrStencilSettings* settings, |
170 StencilClipMode mode, | 166 StencilClipMode mode, |
171 int stencilBitCnt); | 167 int stencilBitCnt); |
172 | 168 |
173 typedef SkNoncopyable INHERITED; | 169 typedef SkNoncopyable INHERITED; |
174 }; | 170 }; |
175 | 171 |
176 #endif // GrClipMaskManager_DEFINED | 172 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |