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