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 #include "GrClipMaskManager.h" | 8 #include "GrClipMaskManager.h" |
9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
10 #include "GrAAHairLinePathRenderer.h" | 10 #include "GrAAHairLinePathRenderer.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 SkIRect clipSpaceIBounds; | 221 SkIRect clipSpaceIBounds; |
222 bool requiresAA; | 222 bool requiresAA; |
223 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); | 223 GrRenderTarget* rt = pipelineBuilder->getRenderTarget(); |
224 | 224 |
225 // GrDrawTarget should have filtered this for us | 225 // GrDrawTarget should have filtered this for us |
226 SkASSERT(rt); | 226 SkASSERT(rt); |
227 | 227 |
228 SkIRect clipSpaceRTIBounds = SkIRect::MakeWH(rt->width(), rt->height()); | 228 SkIRect clipSpaceRTIBounds = SkIRect::MakeWH(rt->width(), rt->height()); |
229 const GrClip& clip = pipelineBuilder->clip(); | 229 const GrClip& clip = pipelineBuilder->clip(); |
230 // TODO we shouldn't be ignoring the clip mask manager's clip. This is temp
orary. | 230 // TODO we shouldn't be ignoring the clip mask manager's clip. This is temp
orary. |
231 bool ignoreClip = clip.isWideOpen(clipSpaceRTIBounds) || | 231 bool ignoreClip = clip.isWideOpen(clipSpaceRTIBounds); |
232 GrClip::kIRect_ClipType == clip.clipType(); | |
233 if (!ignoreClip) { | 232 if (!ignoreClip) { |
234 // The clip mask manager always draws with a single IRect so we special
case that logic here | 233 // The clip mask manager always draws with a single IRect so we special
case that logic here |
235 if (GrClip::kIRect_ClipType == clip.clipType()) { | 234 if (GrClip::kIRect_ClipType == clip.clipType()) { |
236 initialState = GrReducedClip::kAllIn_InitialState; | 235 initialState = GrReducedClip::kAllIn_InitialState; |
237 clipSpaceIBounds = clip.irect(); | 236 clipSpaceIBounds = clip.irect(); |
238 SkNEW_INSERT_AT_LLIST_HEAD(&elements, | 237 SkNEW_INSERT_AT_LLIST_HEAD(&elements, |
239 Element, | 238 Element, |
240 (SkRect::Make(clipSpaceIBounds), | 239 (SkRect::Make(clipSpaceIBounds), |
241 SkRegion::kIntersect_Op, false)); | 240 SkRegion::kIntersect_Op, false)); |
242 } else { | 241 } else { |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 fAACache.setContext(clipTarget->getContext()); | 1102 fAACache.setContext(clipTarget->getContext()); |
1104 } | 1103 } |
1105 | 1104 |
1106 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu
ffer, | 1105 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu
ffer, |
1107 GrStencilSettings* settings) { | 1106 GrStencilSettings* settings) { |
1108 if (stencilBuffer) { | 1107 if (stencilBuffer) { |
1109 int stencilBits = stencilBuffer->bits(); | 1108 int stencilBits = stencilBuffer->bits(); |
1110 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1109 this->adjustStencilParams(settings, fClipMode, stencilBits); |
1111 } | 1110 } |
1112 } | 1111 } |
OLD | NEW |