| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrClipMaskManager.h" | 9 #include "GrClipMaskManager.h" |
| 10 #include "GrAAConvexPathRenderer.h" | 10 #include "GrAAConvexPathRenderer.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // diff RR | 261 // diff RR |
| 262 // isect convex_poly | 262 // isect convex_poly |
| 263 // isect convex_poly | 263 // isect convex_poly |
| 264 // when drawing rounded div borders. This could probably be tuned based on a | 264 // when drawing rounded div borders. This could probably be tuned based on a |
| 265 // configuration's relative costs of switching RTs to generate a mask vs | 265 // configuration's relative costs of switching RTs to generate a mask vs |
| 266 // longer shaders. | 266 // longer shaders. |
| 267 if (elements.count() <= 4) { | 267 if (elements.count() <= 4) { |
| 268 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX), | 268 SkVector clipToRTOffset = { SkIntToScalar(-clipDataIn->fOrigin.fX), |
| 269 SkIntToScalar(-clipDataIn->fOrigin.fY) }; | 269 SkIntToScalar(-clipDataIn->fOrigin.fY) }; |
| 270 if (elements.isEmpty() || | 270 if (elements.isEmpty() || |
| 271 this->installClipEffects(elements, are, clipToRTOffset, devBounds))
{ | 271 (requiresAA && this->installClipEffects(elements, are, clipToRTOffse
t, devBounds))) { |
| 272 SkIRect scissorSpaceIBounds(clipSpaceIBounds); | 272 SkIRect scissorSpaceIBounds(clipSpaceIBounds); |
| 273 scissorSpaceIBounds.offset(-clipDataIn->fOrigin); | 273 scissorSpaceIBounds.offset(-clipDataIn->fOrigin); |
| 274 if (NULL == devBounds || | 274 if (NULL == devBounds || |
| 275 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { | 275 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { |
| 276 fGpu->enableScissor(scissorSpaceIBounds); | 276 fGpu->enableScissor(scissorSpaceIBounds); |
| 277 } else { | 277 } else { |
| 278 fGpu->disableScissor(); | 278 fGpu->disableScissor(); |
| 279 } | 279 } |
| 280 this->setGpuStencil(); | 280 this->setGpuStencil(); |
| 281 return true; | 281 return true; |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1144 | 1144 |
| 1145 // TODO: dynamically attach a stencil buffer | 1145 // TODO: dynamically attach a stencil buffer |
| 1146 int stencilBits = 0; | 1146 int stencilBits = 0; |
| 1147 GrStencilBuffer* stencilBuffer = | 1147 GrStencilBuffer* stencilBuffer = |
| 1148 drawState.getRenderTarget()->getStencilBuffer(); | 1148 drawState.getRenderTarget()->getStencilBuffer(); |
| 1149 if (NULL != stencilBuffer) { | 1149 if (NULL != stencilBuffer) { |
| 1150 stencilBits = stencilBuffer->bits(); | 1150 stencilBits = stencilBuffer->bits(); |
| 1151 this->adjustStencilParams(settings, clipMode, stencilBits); | 1151 this->adjustStencilParams(settings, clipMode, stencilBits); |
| 1152 } | 1152 } |
| 1153 } | 1153 } |
| OLD | NEW |