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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 // Draws a clip element into the target alpha mask. The caller should have a
lready setup the | 127 // Draws a clip element into the target alpha mask. The caller should have a
lready setup the |
128 // desired blend operation. Optionally if the caller already selected a path
renderer it can | 128 // desired blend operation. Optionally if the caller already selected a path
renderer it can |
129 // be passed. Otherwise the function will select one if the element is a pat
h. | 129 // be passed. Otherwise the function will select one if the element is a pat
h. |
130 bool drawElement(GrPipelineBuilder*, | 130 bool drawElement(GrPipelineBuilder*, |
131 const SkMatrix& viewMatrix, | 131 const SkMatrix& viewMatrix, |
132 GrTexture* target, | 132 GrTexture* target, |
133 const SkClipStack::Element*, | 133 const SkClipStack::Element*, |
134 GrPathRenderer* pr = nullptr); | 134 GrPathRenderer* pr = nullptr); |
135 | 135 |
136 // Determines whether it is possible to draw the element to both the stencil
buffer and the | |
137 // alpha mask simultaneously. If so and the element is a path a compatible p
ath renderer is | |
138 // also returned. | |
139 bool canStencilAndDrawElement(GrPipelineBuilder*, | |
140 GrTexture* target, | |
141 GrPathRenderer**, | |
142 const SkClipStack::Element*); | |
143 | |
144 void mergeMask(GrPipelineBuilder*, | 136 void mergeMask(GrPipelineBuilder*, |
145 GrTexture* dstMask, | 137 GrTexture* dstMask, |
146 GrTexture* srcMask, | 138 GrTexture* srcMask, |
147 SkRegion::Op op, | 139 SkRegion::Op op, |
148 const SkIRect& dstBound, | 140 const SkIRect& dstBound, |
149 const SkIRect& srcBound); | 141 const SkIRect& srcBound); |
150 | 142 |
151 GrTexture* createTempMask(int width, int height); | 143 GrTexture* createTempMask(int width, int height); |
152 | 144 |
153 /** | 145 /** |
(...skipping 14 matching lines...) Expand all Loading... |
168 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); | 160 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); |
169 | 161 |
170 static const int kMaxAnalyticElements = 4; | 162 static const int kMaxAnalyticElements = 4; |
171 | 163 |
172 GrDrawTarget* fDrawTarget; // This is our owning draw target. | 164 GrDrawTarget* fDrawTarget; // This is our owning draw target. |
173 StencilClipMode fClipMode; | 165 StencilClipMode fClipMode; |
174 | 166 |
175 typedef SkNoncopyable INHERITED; | 167 typedef SkNoncopyable INHERITED; |
176 }; | 168 }; |
177 #endif // GrClipMaskManager_DEFINED | 169 #endif // GrClipMaskManager_DEFINED |
OLD | NEW |