diff options
author | 2014-12-11 15:44:02 -0800 | |
---|---|---|
committer | 2014-12-11 15:44:02 -0800 | |
commit | 56995b5cc00c9c83bd5fcf86bca9a67e939a96cb (patch) | |
tree | 5afd6c8625f50f0dcdb17e0c7ac8854fbda53495 /src/gpu/GrBitmapTextContext.cpp | |
parent | 5756aff40921e700dc40f2a1757291a64acddeaa (diff) |
Remove GP from drawstate, revision of invariant output for GP
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da
Review URL: https://codereview.chromium.org/791743003
Diffstat (limited to 'src/gpu/GrBitmapTextContext.cpp')
-rwxr-xr-x | src/gpu/GrBitmapTextContext.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp index 6a624ae23e..bf27584f26 100755 --- a/src/gpu/GrBitmapTextContext.cpp +++ b/src/gpu/GrBitmapTextContext.cpp @@ -549,8 +549,6 @@ void GrBitmapTextContext::flush() { } // Grayscale/BW text case kA8_GrMaskFormat: - drawState.setHint(GrDrawState::kVertexColorsAreOpaque_Hint, - 0xFF == GrColorUnpackA(fPaint.getColor())); break; default: SkFAIL("Unexpected mask format."); @@ -561,32 +559,33 @@ void GrBitmapTextContext::flush() { if (kARGB_GrMaskFormat == fCurrMaskFormat) { uint32_t textureUniqueID = fCurrTexture->getUniqueID(); if (textureUniqueID != fEffectTextureUniqueID || - fCachedGeometryProcessor->getColor() != color) { + fCachedGeometryProcessor->color() != color) { uint32_t flags = GrDefaultGeoProcFactory::kLocalCoord_GPType; fCachedGeometryProcessor.reset(GrDefaultGeoProcFactory::Create(color, flags)); fCachedTextureProcessor.reset(GrSimpleTextureEffect::Create(fCurrTexture, SkMatrix::I(), params)); } - drawState.setGeometryProcessor(fCachedGeometryProcessor.get()); drawState.addColorProcessor(fCachedTextureProcessor.get()); } else { uint32_t textureUniqueID = fCurrTexture->getUniqueID(); if (textureUniqueID != fEffectTextureUniqueID || - fCachedGeometryProcessor->getColor() != color) { + fCachedGeometryProcessor->color() != color) { bool hasColor = kA8_GrMaskFormat == fCurrMaskFormat; + bool opaqueVertexColors = GrColorIsOpaque(fPaint.getColor()); fCachedGeometryProcessor.reset(GrBitmapTextGeoProc::Create(color, - fCurrTexture, - params, - hasColor)); + fCurrTexture, + params, + hasColor, + opaqueVertexColors)); fEffectTextureUniqueID = textureUniqueID; } - drawState.setGeometryProcessor(fCachedGeometryProcessor.get()); } int nGlyphs = fCurrVertex / kVerticesPerGlyph; fDrawTarget->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); fDrawTarget->drawIndexedInstances(&drawState, + fCachedGeometryProcessor.get(), kTriangles_GrPrimitiveType, nGlyphs, kVerticesPerGlyph, |