diff options
author | 2015-02-11 06:56:30 -0800 | |
---|---|---|
committer | 2015-02-11 06:56:30 -0800 | |
commit | 02b05015b55d1900a9e34039942101da189053ce (patch) | |
tree | e7162807a7a960539d3fe40796594654a528570c /src/gpu/GrBitmapTextContext.cpp | |
parent | 9e33d1dbccee9b13ac001dfc3094a503f9e84e9d (diff) |
Small change to use a GrGeometryProcessor for all BitmapText draw calls
BUG=skia:
Review URL: https://codereview.chromium.org/914723002
Diffstat (limited to 'src/gpu/GrBitmapTextContext.cpp')
-rwxr-xr-x | src/gpu/GrBitmapTextContext.cpp | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp index 4af5c0ad04..5e5aa6a3cd 100755 --- a/src/gpu/GrBitmapTextContext.cpp +++ b/src/gpu/GrBitmapTextContext.cpp @@ -561,33 +561,19 @@ void GrBitmapTextContext::flush() { } GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kNone_FilterMode); - if (kARGB_GrMaskFormat == fCurrMaskFormat) { - uint32_t textureUniqueID = fCurrTexture->getUniqueID(); - if (textureUniqueID != fEffectTextureUniqueID || - fCachedGeometryProcessor->color() != color) { - uint32_t flags = GrDefaultGeoProcFactory::kLocalCoord_GPType; - fCachedGeometryProcessor.reset(GrDefaultGeoProcFactory::Create(flags, color)); - fCachedTextureProcessor.reset(GrSimpleTextureEffect::Create(fCurrTexture, - SkMatrix::I(), - params)); - fEffectTextureUniqueID = textureUniqueID; - } - pipelineBuilder.addColorProcessor(fCachedTextureProcessor.get()); - } else { - uint32_t textureUniqueID = fCurrTexture->getUniqueID(); - if (textureUniqueID != fEffectTextureUniqueID || - fCachedGeometryProcessor->color() != color || - !fCachedGeometryProcessor->localMatrix().cheapEqualTo(fLocalMatrix)) { - bool hasColor = kA8_GrMaskFormat == fCurrMaskFormat; - bool opaqueVertexColors = GrColorIsOpaque(fPaint.getColor()); - fCachedGeometryProcessor.reset(GrBitmapTextGeoProc::Create(color, - fCurrTexture, - params, - hasColor, - opaqueVertexColors, - fLocalMatrix)); - fEffectTextureUniqueID = textureUniqueID; - } + uint32_t textureUniqueID = fCurrTexture->getUniqueID(); + if (textureUniqueID != fEffectTextureUniqueID || + fCachedGeometryProcessor->color() != color || + !fCachedGeometryProcessor->localMatrix().cheapEqualTo(fLocalMatrix)) { + // This will be ignored in the non A8 case + bool opaqueVertexColors = GrColorIsOpaque(fPaint.getColor()); + fCachedGeometryProcessor.reset(GrBitmapTextGeoProc::Create(color, + fCurrTexture, + params, + fCurrMaskFormat, + opaqueVertexColors, + fLocalMatrix)); + fEffectTextureUniqueID = textureUniqueID; } int nGlyphs = fCurrVertex / kVerticesPerGlyph; |