Index: src/gpu/GrDistanceFieldTextContext.cpp |
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp |
index 641d0c1e01eff1056fadac148e755313f619ee0a..d25757c6956b49d52781f18f580f1f45aec8f60a 100755 |
--- a/src/gpu/GrDistanceFieldTextContext.cpp |
+++ b/src/gpu/GrDistanceFieldTextContext.cpp |
@@ -415,6 +415,7 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo |
flags)); |
} else { |
flags |= kColorAttr_DistanceFieldEffectFlag; |
+ bool opaque = GrColorIsOpaque(color); |
#ifdef SK_GAMMA_APPLY_TO_A8 |
U8CPU lum = SkColorSpaceLuminance::computeLuminance(fDeviceProperties.gamma(), |
filteredColor); |
@@ -424,12 +425,14 @@ void GrDistanceFieldTextContext::setupCoverageEffect(const SkColor& filteredColo |
fGammaTexture, |
gammaParams, |
lum/255.f, |
- flags)); |
+ flags, |
+ opaque)); |
#else |
fCachedGeometryProcessor.reset(GrDistanceFieldNoGammaTextureEffect::Create(color, |
fCurrTexture, |
params, |
- flags)); |
+ flags, |
+ opaque)); |
#endif |
} |
fEffectTextureUniqueID = textureUniqueID; |
@@ -637,9 +640,6 @@ void GrDistanceFieldTextContext::flush() { |
} |
this->setupCoverageEffect(filteredColor); |
- // Effects could be stored with one of the cache objects (atlas?) |
- drawState.setGeometryProcessor(fCachedGeometryProcessor.get()); |
- |
// Set draw state |
if (fUseLCDText) { |
// TODO: move supportsRGBCoverage check to setupCoverageEffect and only add LCD |
@@ -648,17 +648,15 @@ void GrDistanceFieldTextContext::flush() { |
if (!drawState.getXPFactory()->supportsRGBCoverage(0, kRGBA_GrColorComponentFlags)) { |
SkDebugf("LCD Text will not draw correctly.\n"); |
} |
- SkASSERT(!drawState.hasColorVertexAttribute()); |
+ SkASSERT(!fCachedGeometryProcessor->hasVertexColor()); |
} else { |
- if (0xFF == GrColorUnpackA(fPaint.getColor())) { |
- drawState.setHint(GrDrawState::kVertexColorsAreOpaque_Hint, true); |
- } |
// We're using per-vertex color. |
- SkASSERT(drawState.hasColorVertexAttribute()); |
+ SkASSERT(fCachedGeometryProcessor->hasVertexColor()); |
} |
int nGlyphs = fCurrVertex / kVerticesPerGlyph; |
fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); |
fDrawTarget->drawIndexedInstances(&drawState, |
+ fCachedGeometryProcessor.get(), |
kTriangles_GrPrimitiveType, |
nGlyphs, |
kVerticesPerGlyph, |