diff options
author | joshualitt <joshualitt@chromium.org> | 2014-12-22 15:27:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-22 15:27:05 -0800 |
commit | 8fc6c2d82c1f30ff82274334c01f0799def6a609 (patch) | |
tree | 6499d32fd02b524167a690704d855e804f66c8a3 /src/gpu/effects/GrBitmapTextGeoProc.cpp | |
parent | 16c8f14cd481b78673a33450a1395958e3e10e62 (diff) |
This CL cleans up the last remaining users of localCoordChange on paint
NOTREECHECKS=True
BUG=skia:
Review URL: https://codereview.chromium.org/817853002
Diffstat (limited to 'src/gpu/effects/GrBitmapTextGeoProc.cpp')
-rw-r--r-- | src/gpu/effects/GrBitmapTextGeoProc.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp index 09eee1c70d..44de98a348 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)); } |