| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 if (NULL == devBounds || | 299 if (NULL == devBounds || |
| 300 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { | 300 !SkRect::Make(scissorSpaceIBounds).contains(*devBounds)) { |
| 301 scissorState->set(scissorSpaceIBounds); | 301 scissorState->set(scissorSpaceIBounds); |
| 302 } | 302 } |
| 303 this->setPipelineBuilderStencil(pipelineBuilder, ars); | 303 this->setPipelineBuilderStencil(pipelineBuilder, ars); |
| 304 return true; | 304 return true; |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 // If MSAA is enabled we can do everything in the stencil buffer. | 308 // If MSAA is enabled we can do everything in the stencil buffer. |
| 309 if (0 == rt->numSamples() && requiresAA) { | 309 if (0 == rt->numColorSamples() && requiresAA) { |
| 310 GrTexture* result = NULL; | 310 GrTexture* result = NULL; |
| 311 | 311 |
| 312 // The top-left of the mask corresponds to the top-left corner of the bo
unds. | 312 // The top-left of the mask corresponds to the top-left corner of the bo
unds. |
| 313 SkVector clipToMaskOffset = { | 313 SkVector clipToMaskOffset = { |
| 314 SkIntToScalar(-clipSpaceIBounds.fLeft), | 314 SkIntToScalar(-clipSpaceIBounds.fLeft), |
| 315 SkIntToScalar(-clipSpaceIBounds.fTop) | 315 SkIntToScalar(-clipSpaceIBounds.fTop) |
| 316 }; | 316 }; |
| 317 | 317 |
| 318 if (this->useSWOnlyPath(pipelineBuilder, clipToMaskOffset, elements)) { | 318 if (this->useSWOnlyPath(pipelineBuilder, clipToMaskOffset, elements)) { |
| 319 // The clip geometry is complex enough that it will be more efficien
t to create it | 319 // The clip geometry is complex enough that it will be more efficien
t to create it |
| (...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 fAACache.purgeResources(); | 1119 fAACache.purgeResources(); |
| 1120 } | 1120 } |
| 1121 | 1121 |
| 1122 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, | 1122 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, |
| 1123 GrStencilSettings* settings) { | 1123 GrStencilSettings* settings) { |
| 1124 if (stencilAttachment) { | 1124 if (stencilAttachment) { |
| 1125 int stencilBits = stencilAttachment->bits(); | 1125 int stencilBits = stencilAttachment->bits(); |
| 1126 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1126 this->adjustStencilParams(settings, fClipMode, stencilBits); |
| 1127 } | 1127 } |
| 1128 } | 1128 } |
| OLD | NEW |