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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 GrSurfaceDesc desc; | 489 GrSurfaceDesc desc; |
490 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 490 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
491 desc.fWidth = width; | 491 desc.fWidth = width; |
492 desc.fHeight = height; | 492 desc.fHeight = height; |
493 if (this->getContext()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { | 493 if (this->getContext()->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { |
494 desc.fConfig = kAlpha_8_GrPixelConfig; | 494 desc.fConfig = kAlpha_8_GrPixelConfig; |
495 } else { | 495 } else { |
496 desc.fConfig = kRGBA_8888_GrPixelConfig; | 496 desc.fConfig = kRGBA_8888_GrPixelConfig; |
497 } | 497 } |
498 | 498 |
499 return this->getContext()->refScratchTexture(desc, GrContext::kApprox_Scratc
hTexMatch); | 499 return this->getContext()->textureProvider()->refScratchTexture( |
| 500 desc, GrTextureProvider::kApprox_ScratchTexMatch); |
500 } | 501 } |
501 | 502 |
502 //////////////////////////////////////////////////////////////////////////////// | 503 //////////////////////////////////////////////////////////////////////////////// |
503 // Return the texture currently in the cache if it exists. Otherwise, return NUL
L | 504 // Return the texture currently in the cache if it exists. Otherwise, return NUL
L |
504 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID, | 505 GrTexture* GrClipMaskManager::getCachedMaskTexture(int32_t elementsGenID, |
505 const SkIRect& clipSpaceIBoun
ds) { | 506 const SkIRect& clipSpaceIBoun
ds) { |
506 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds); | 507 bool cached = fAACache.canReuse(elementsGenID, clipSpaceIBounds); |
507 if (!cached) { | 508 if (!cached) { |
508 return NULL; | 509 return NULL; |
509 } | 510 } |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 fAACache.setContext(clipTarget->getContext()); | 1115 fAACache.setContext(clipTarget->getContext()); |
1115 } | 1116 } |
1116 | 1117 |
1117 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, | 1118 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, |
1118 GrStencilSettings* settings) { | 1119 GrStencilSettings* settings) { |
1119 if (stencilAttachment) { | 1120 if (stencilAttachment) { |
1120 int stencilBits = stencilAttachment->bits(); | 1121 int stencilBits = stencilAttachment->bits(); |
1121 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1122 this->adjustStencilParams(settings, fClipMode, stencilBits); |
1122 } | 1123 } |
1123 } | 1124 } |
OLD | NEW |