diff options
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrBezierEffect.cpp | 3 | ||||
-rw-r--r-- | src/gpu/effects/GrBitmapTextGeoProc.cpp | 15 | ||||
-rw-r--r-- | src/gpu/effects/GrBitmapTextGeoProc.h | 8 | ||||
-rw-r--r-- | src/gpu/effects/GrDashingEffect.cpp | 2 | ||||
-rwxr-xr-x | src/gpu/effects/GrDistanceFieldTextureEffect.cpp | 18 |
5 files changed, 32 insertions, 14 deletions
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp index 2a4ef3692f..0ba7beeb88 100644 --- a/src/gpu/effects/GrBezierEffect.cpp +++ b/src/gpu/effects/GrBezierEffect.cpp @@ -165,6 +165,7 @@ void GrGLConicEffect::GenKey(const GrGeometryProcessor& processor, uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2; key |= kUniform_GrGPInput == local.fInputColorType ? 0x4 : 0x0; key |= 0xff != local.fCoverageScale ? 0x8 : 0x0; + key |= local.fUsesLocalCoords && processor.localMatrix().hasPerspective() ? 0x10 : 0x0; b->add32(key); } @@ -374,6 +375,7 @@ void GrGLQuadEffect::GenKey(const GrGeometryProcessor& processor, uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2; key |= kUniform_GrGPInput == local.fInputColorType ? 0x4 : 0x0; key |= 0xff != local.fCoverageScale ? 0x8 : 0x0; + key |= local.fUsesLocalCoords && processor.localMatrix().hasPerspective() ? 0x10 : 0x0; b->add32(key); } @@ -605,6 +607,7 @@ void GrGLCubicEffect::GenKey(const GrGeometryProcessor& processor, const CubicBatchTracker& local = bt.cast<CubicBatchTracker>(); uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2; key |= kUniform_GrGPInput == local.fInputColorType ? 0x4 : 0x8; + key |= local.fUsesLocalCoords && processor.localMatrix().hasPerspective() ? 0x10 : 0x0; b->add32(key); } 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)); } diff --git a/src/gpu/effects/GrBitmapTextGeoProc.h b/src/gpu/effects/GrBitmapTextGeoProc.h index 507515bedb..c69ffd7a1b 100644 --- a/src/gpu/effects/GrBitmapTextGeoProc.h +++ b/src/gpu/effects/GrBitmapTextGeoProc.h @@ -22,8 +22,10 @@ class GrInvariantOutput; class GrBitmapTextGeoProc : public GrGeometryProcessor { public: static GrGeometryProcessor* Create(GrColor color, GrTexture* tex, const GrTextureParams& p, - bool useColorAttrib, bool opaqueVertexColors) { - return SkNEW_ARGS(GrBitmapTextGeoProc, (color, tex, p, useColorAttrib, opaqueVertexColors)); + bool useColorAttrib, bool opaqueVertexColors, + const SkMatrix& localMatrix) { + return SkNEW_ARGS(GrBitmapTextGeoProc, (color, tex, p, useColorAttrib, opaqueVertexColors, + localMatrix)); } virtual ~GrBitmapTextGeoProc() {} @@ -47,7 +49,7 @@ public: private: GrBitmapTextGeoProc(GrColor, GrTexture* texture, const GrTextureParams& params, - bool useColorAttrib, bool opaqueVertexColors); + bool useColorAttrib, bool opaqueVertexColors, const SkMatrix& localMatrix); virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp index 35b763788a..d5b0b48e9b 100644 --- a/src/gpu/effects/GrDashingEffect.cpp +++ b/src/gpu/effects/GrDashingEffect.cpp @@ -624,6 +624,7 @@ void GLDashingCircleEffect::GenKey(const GrGeometryProcessor& processor, GrProcessorKeyBuilder* b) { const DashingCircleBatchTracker& local = bt.cast<DashingCircleBatchTracker>(); const DashingCircleEffect& dce = processor.cast<DashingCircleEffect>(); + b->add32(local.fUsesLocalCoords && processor.localMatrix().hasPerspective()); b->add32(dce.getEdgeType() << 16 | local.fInputColorType); } @@ -913,6 +914,7 @@ void GLDashingLineEffect::GenKey(const GrGeometryProcessor& processor, GrProcessorKeyBuilder* b) { const DashingLineBatchTracker& local = bt.cast<DashingLineBatchTracker>(); const DashingLineEffect& de = processor.cast<DashingLineEffect>(); + b->add32(local.fUsesLocalCoords && processor.localMatrix().hasPerspective()); b->add32(de.getEdgeType() << 16 | local.fInputColorType); } diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp index 0f930af371..f5510d478b 100755 --- a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp +++ b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp @@ -166,8 +166,10 @@ public: const GrDistanceFieldTextureEffect& dfTexEffect = processor.cast<GrDistanceFieldTextureEffect>(); const DistanceFieldBatchTracker& local = bt.cast<DistanceFieldBatchTracker>(); - b->add32(dfTexEffect.getFlags()); - b->add32(local.fInputColorType); + uint32_t key = dfTexEffect.getFlags(); + key |= local.fInputColorType << 16; + key |= local.fUsesLocalCoords && processor.localMatrix().hasPerspective() ? 0x1 << 24: 0x0; + b->add32(key); } private: @@ -422,8 +424,10 @@ public: proc.cast<GrDistanceFieldNoGammaTextureEffect>(); const DistanceFieldNoGammaBatchTracker& local = bt.cast<DistanceFieldNoGammaBatchTracker>(); - b->add32(dfTexEffect.getFlags()); - b->add32(local.fInputColorType); + uint32_t key = dfTexEffect.getFlags(); + key |= local.fInputColorType << 16; + key |= local.fUsesLocalCoords && proc.localMatrix().hasPerspective() ? 0x1 << 24: 0x0; + b->add32(key); } private: @@ -724,8 +728,10 @@ public: processor.cast<GrDistanceFieldLCDTextureEffect>(); const DistanceFieldLCDBatchTracker& local = bt.cast<DistanceFieldLCDBatchTracker>(); - b->add32(dfTexEffect.getFlags()); - b->add32(local.fInputColorType); + uint32_t key = dfTexEffect.getFlags(); + key |= local.fInputColorType << 16; + key |= local.fUsesLocalCoords && processor.localMatrix().hasPerspective() ? 0x1 << 24: 0x0; + b->add32(key); } private: |