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

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

Issue 817853002: Remove localcoordchange functions off paint (Closed) Base URL: https://skia.googlesource.com/skia.git@local-matrix-on-gp
Patch Set: changing ignores 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/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBitmapTextGeoProc.cpp
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 09eee1c70d1ba106be2843d0acf130a178798ae9..44de98a348d75f0b279aedcd9ed6d5b5b9fcca69 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -75,8 +75,10 @@ public:
// on addVertexAttrib.
// TODO When we have deferred geometry we can fix this
const GrBitmapTextGeoProc& gp = proc.cast<GrBitmapTextGeoProc>();
- b->add32(SkToBool(gp.inColor()));
- b->add32(local.fInputColorType);
+ uint32_t key = 0;
+ key |= SkToBool(gp.inColor()) ? 0x1 : 0x0;
+ key |= local.fUsesLocalCoords && proc.localMatrix().hasPerspective() ? 0x2 : 0x0;
+ b->add32(local.fInputColorType << 16 | key);
}
private:
@@ -90,8 +92,10 @@ private:
GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture,
const GrTextureParams& params, bool useColorAttrib,
- bool opaqueVertexColors)
- : INHERITED(color, opaqueVertexColors), fTextureAccess(texture, params), fInColor(NULL) {
+ bool opaqueVertexColors, const SkMatrix& localMatrix)
+ : INHERITED(color, opaqueVertexColors, localMatrix)
+ , fTextureAccess(texture, params)
+ , fInColor(NULL) {
this->initClassID<GrBitmapTextGeoProc>();
fInPosition = &this->addVertexAttrib(GrAttribute("inPosition", kVec2f_GrVertexAttribType));
if (useColorAttrib) {
@@ -172,5 +176,6 @@ GrGeometryProcessor* GrBitmapTextGeoProc::TestCreate(SkRandom* random,
GrTextureParams::kNone_FilterMode);
return GrBitmapTextGeoProc::Create(GrRandomColor(random), textures[texIdx], params,
- random->nextBool(), random->nextBool());
+ random->nextBool(), random->nextBool(),
+ GrProcessorUnitTest::TestMatrix(random));
}
« no previous file with comments | « src/gpu/effects/GrBitmapTextGeoProc.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698