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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 setup_drawstate_aaclip(pipelineBuilder, result, arfps, rtSpaceMaskBo
unds); | 342 setup_drawstate_aaclip(pipelineBuilder, result, arfps, rtSpaceMaskBo
unds); |
343 this->setPipelineBuilderStencil(pipelineBuilder, ars); | 343 this->setPipelineBuilderStencil(pipelineBuilder, ars); |
344 return true; | 344 return true; |
345 } | 345 } |
346 // if alpha clip mask creation fails fall through to the non-AA code pat
hs | 346 // if alpha clip mask creation fails fall through to the non-AA code pat
hs |
347 } | 347 } |
348 | 348 |
349 // Either a hard (stencil buffer) clip was explicitly requested or an anti-a
liased clip couldn't | 349 // Either a hard (stencil buffer) clip was explicitly requested or an anti-a
liased clip couldn't |
350 // be created. In either case, free up the texture in the anti-aliased mask
cache. | 350 // be created. In either case, free up the texture in the anti-aliased mask
cache. |
351 // TODO: this may require more investigation. Ganesh performs a lot of utili
ty draws (e.g., | 351 // TODO: this may require more investigation. Ganesh performs a lot of utili
ty draws (e.g., |
352 // clears, InOrderDrawBuffer playbacks) that hit the stencil buffer path. Th
ese may be | 352 // clears, GrBufferedDrawTarget playbacks) that hit the stencil buffer path.
These may be |
353 // "incorrectly" clearing the AA cache. | 353 // "incorrectly" clearing the AA cache. |
354 fAACache.reset(); | 354 fAACache.reset(); |
355 | 355 |
356 // use the stencil clip if we can't represent the clip as a rectangle. | 356 // use the stencil clip if we can't represent the clip as a rectangle. |
357 SkIPoint clipSpaceToStencilSpaceOffset = -clip.origin(); | 357 SkIPoint clipSpaceToStencilSpaceOffset = -clip.origin(); |
358 this->createStencilClipMask(rt, | 358 this->createStencilClipMask(rt, |
359 genID, | 359 genID, |
360 initialState, | 360 initialState, |
361 elements, | 361 elements, |
362 clipSpaceIBounds, | 362 clipSpaceIBounds, |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 fAACache.purgeResources(); | 1121 fAACache.purgeResources(); |
1122 } | 1122 } |
1123 | 1123 |
1124 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, | 1124 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, |
1125 GrStencilSettings* settings) { | 1125 GrStencilSettings* settings) { |
1126 if (stencilAttachment) { | 1126 if (stencilAttachment) { |
1127 int stencilBits = stencilAttachment->bits(); | 1127 int stencilBits = stencilAttachment->bits(); |
1128 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1128 this->adjustStencilParams(settings, fClipMode, stencilBits); |
1129 } | 1129 } |
1130 } | 1130 } |
OLD | NEW |