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

Unified Diff: src/gpu/GrDistanceFieldTextContext.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/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698