aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBitmapTextContext.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-02-11 06:56:30 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-02-11 06:56:30 -0800
commit02b05015b55d1900a9e34039942101da189053ce (patch)
treee7162807a7a960539d3fe40796594654a528570c /src/gpu/GrBitmapTextContext.cpp
parent9e33d1dbccee9b13ac001dfc3094a503f9e84e9d (diff)
Small change to use a GrGeometryProcessor for all BitmapText draw calls
Diffstat (limited to 'src/gpu/GrBitmapTextContext.cpp')
-rwxr-xr-xsrc/gpu/GrBitmapTextContext.cpp40
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;