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

Unified Diff: src/gpu/effects/GrDistanceFieldGeoProc.cpp

Issue 1502253003: Allow LCD text to batch across colorchanges. This will always use (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 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/effects/GrDistanceFieldGeoProc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldGeoProc.cpp
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index fab936903eb2b21be03361aa5de921f287691309..f6c41cbf1924621a0718a02e1d1ebe5ceade3e7e 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -416,7 +416,7 @@ public:
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
- if (dfpgp.color() != fColor) {
+ if (dfpgp.color() != fColor && !dfpgp.hasVertexColor()) {
float c[4];
GrColorToRGBAFloat(dfpgp.color(), c);
pdman.set4fv(fColorUniform, 1, c);
@@ -535,7 +535,12 @@ public:
// setup pass through color
if (!dfTexEffect.colorIgnored()) {
- this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor, &fColorUniform);
+ if (dfTexEffect.hasVertexColor()) {
+ varyingHandler->addPassThroughAttribute(dfTexEffect.inColor(), args.fOutputColor);
+ } else {
+ this->setupUniformColor(fragBuilder, uniformHandler, args.fOutputColor,
+ &fColorUniform);
+ }
}
// Setup position
@@ -696,7 +701,7 @@ public:
pdman.setMatrix3f(fViewMatrixUniform, viewMatrix);
}
- if (dflcd.color() != fColor) {
+ if (dflcd.color() != fColor && !dflcd.hasVertexColor()) {
float c[4];
GrColorToRGBAFloat(dflcd.color(), c);
pdman.set4fv(fColorUniform, 1, c);
@@ -750,6 +755,9 @@ GrDistanceFieldLCDTextGeoProc::GrDistanceFieldLCDTextGeoProc(
this->initClassID<GrDistanceFieldLCDTextGeoProc>();
fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType,
kHigh_GrSLPrecision));
+ if (flags & kColorAttr_DistanceFieldEffectFlag) {
+ fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType));
+ }
fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords",
kVec2s_GrVertexAttribType));
this->addTextureAccess(&fTextureAccess);
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698