Chromium Code Reviews| Index: src/gpu/effects/GrBitmapTextGeoProc.cpp |
| diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp |
| index 09eee1c70d1ba106be2843d0acf130a178798ae9..15b756641b36eac6edbec180955c6f9b9cc80c6a 100644 |
| --- a/src/gpu/effects/GrBitmapTextGeoProc.cpp |
| +++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp |
| @@ -75,7 +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())); |
| + uint32_t key = 0; |
| + key |= SkToBool(gp.inColor()) ? 0x1 : 0x0; |
| + key |= local.fUsesLocalCoords && proc.localMatrix().hasPerspective() ? 0x4 : 0x0; |
|
bsalomon
2014/12/22 21:13:55
0x2?
|
| + b->add32(key); |
| b->add32(local.fInputColorType); |
|
bsalomon
2014/12/22 21:13:55
Seems like colorInputType would fit in the availab
|
| } |
| @@ -90,8 +93,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 +177,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)); |
| } |