Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 914723002: Small change to use a GrGeometryProcessor for all BitmapText draw calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: adding bench Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrBitmapTextContext.h ('k') | src/gpu/effects/GrBitmapTextGeoProc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBitmapTextContext.cpp
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index 4af5c0ad0480bc18a033f8f14e3f9673173179f5..5e5aa6a3cd06ef54f9c41cfc7868d61463283701 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;
« no previous file with comments | « src/gpu/GrBitmapTextContext.h ('k') | src/gpu/effects/GrBitmapTextGeoProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698