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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // diff RR | 256 // diff RR |
257 // isect convex_poly | 257 // isect convex_poly |
258 // isect convex_poly | 258 // isect convex_poly |
259 // when drawing rounded div borders. This could probably be tuned based on a | 259 // when drawing rounded div borders. This could probably be tuned based on a |
260 // configuration's relative costs of switching RTs to generate a mask vs | 260 // configuration's relative costs of switching RTs to generate a mask vs |
261 // longer shaders. | 261 // longer shaders. |
262 if (elements.count() <= 4) { | 262 if (elements.count() <= 4) { |
263 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX), | 263 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX), |
264 SkIntToScalar(-clipDataIn->fOrigin.fY) }; | 264 SkIntToScalar(-clipDataIn->fOrigin.fY) }; |
265 if (elements.isEmpty() || | 265 if (elements.isEmpty() || |
266 (requiresAA && this->installClipEffects(pipelineBuilder, are, elemen
ts, clipToRTOffset, | 266 this->installClipEffects(pipelineBuilder, are, elements, clipToRTOff
set, devBounds)) { |
267 devBounds))) { | |
268 SkIRect scissorSpaceIBounds(clipSpaceIBounds); | 267 SkIRect scissorSpaceIBounds(clipSpaceIBounds); |
269 scissorSpaceIBounds.offset(-clipDataIn->fOrigin); | 268 scissorSpaceIBounds.offset(-clipDataIn->fOrigin); |
270 if (NULL == devBounds || | 269 if (NULL == devBounds || |
271 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { | 270 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { |
272 scissorState->set(scissorSpaceIBounds); | 271 scissorState->set(scissorSpaceIBounds); |
273 } | 272 } |
274 this->setPipelineBuilderStencil(pipelineBuilder, ars); | 273 this->setPipelineBuilderStencil(pipelineBuilder, ars); |
275 return true; | 274 return true; |
276 } | 275 } |
277 } | 276 } |
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 fAACache.setContext(clipTarget->getContext()); | 1081 fAACache.setContext(clipTarget->getContext()); |
1083 } | 1082 } |
1084 | 1083 |
1085 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu
ffer, | 1084 void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBu
ffer, |
1086 GrStencilSettings* settings) { | 1085 GrStencilSettings* settings) { |
1087 if (stencilBuffer) { | 1086 if (stencilBuffer) { |
1088 int stencilBits = stencilBuffer->bits(); | 1087 int stencilBits = stencilBuffer->bits(); |
1089 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1088 this->adjustStencilParams(settings, fClipMode, stencilBits); |
1090 } | 1089 } |
1091 } | 1090 } |
OLD | NEW |