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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 791743003: Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: more windows fix Created 6 years 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/GrAARectRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('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 6a624ae23e2fc030e401e8a213b66e60e96e3e39..bf27584f26c4309dfe5261c314c413298c39ef4d 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,
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698