| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 // There isn't a suitable entry in the cache so we create a new texture
to store the mask. | 399 // There isn't a suitable entry in the cache so we create a new texture
to store the mask. |
| 400 // Since we are setting up the cache we know the last lookup was a miss.
Free up the | 400 // Since we are setting up the cache we know the last lookup was a miss.
Free up the |
| 401 // currently cached mask so it can be reused. | 401 // currently cached mask so it can be reused. |
| 402 fAACache.reset(); | 402 fAACache.reset(); |
| 403 | 403 |
| 404 GrTextureDesc desc; | 404 GrTextureDesc desc; |
| 405 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 405 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
| 406 desc.fWidth = clipSpaceIBounds.width(); | 406 desc.fWidth = clipSpaceIBounds.width(); |
| 407 desc.fHeight = clipSpaceIBounds.height(); | 407 desc.fHeight = clipSpaceIBounds.height(); |
| 408 desc.fConfig = kRGBA_8888_GrPixelConfig; | 408 desc.fConfig = kRGBA_8888_GrPixelConfig; |
| 409 if (this->getContext()->isConfigRenderable(kAlpha_8_GrPixelConfig)) { | 409 if (this->getContext()->isConfigRenderable(kAlpha_8_GrPixelConfig, false
)) { |
| 410 // We would always like A8 but it isn't supported on all platforms | 410 // We would always like A8 but it isn't supported on all platforms |
| 411 desc.fConfig = kAlpha_8_GrPixelConfig; | 411 desc.fConfig = kAlpha_8_GrPixelConfig; |
| 412 } | 412 } |
| 413 | 413 |
| 414 fAACache.acquireMask(clipStackGenID, desc, clipSpaceIBounds); | 414 fAACache.acquireMask(clipStackGenID, desc, clipSpaceIBounds); |
| 415 } | 415 } |
| 416 | 416 |
| 417 *result = fAACache.getLastMask(); | 417 *result = fAACache.getLastMask(); |
| 418 return cached; | 418 return cached; |
| 419 } | 419 } |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 | 1030 |
| 1031 // TODO: dynamically attach a stencil buffer | 1031 // TODO: dynamically attach a stencil buffer |
| 1032 int stencilBits = 0; | 1032 int stencilBits = 0; |
| 1033 GrStencilBuffer* stencilBuffer = | 1033 GrStencilBuffer* stencilBuffer = |
| 1034 drawState.getRenderTarget()->getStencilBuffer(); | 1034 drawState.getRenderTarget()->getStencilBuffer(); |
| 1035 if (NULL != stencilBuffer) { | 1035 if (NULL != stencilBuffer) { |
| 1036 stencilBits = stencilBuffer->bits(); | 1036 stencilBits = stencilBuffer->bits(); |
| 1037 this->adjustStencilParams(settings, clipMode, stencilBits); | 1037 this->adjustStencilParams(settings, clipMode, stencilBits); |
| 1038 } | 1038 } |
| 1039 } | 1039 } |
| OLD | NEW |