diff options
author | Brian Salomon <bsalomon@google.com> | 2017-07-13 11:20:51 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-13 15:46:32 +0000 |
commit | 0596909b055eb9493ba429cc09eae4a2ec53f158 (patch) | |
tree | 4c4383ea45f17893ab47c01c61fcff9b06288706 /src/gpu/effects | |
parent | 79e4d1b5dd5901c34c732252f814fdea4358ed3b (diff) |
Make ShadowRRectOp a non-legacy GrMeshDrawOp
This also removes the ability to have an arbitrary GrPaint with this op and as a consequence simplifies the op and its GrGeometryProcessor.
Change-Id: I19cc1c6f73a47e8925fc826291aad42e9423164d
Reviewed-on: https://skia-review.googlesource.com/22380
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r-- | src/gpu/effects/GrShadowGeoProc.cpp | 24 | ||||
-rw-r--r-- | src/gpu/effects/GrShadowGeoProc.h | 12 |
2 files changed, 7 insertions, 29 deletions
diff --git a/src/gpu/effects/GrShadowGeoProc.cpp b/src/gpu/effects/GrShadowGeoProc.cpp index 5ff7ec1caf..6ab993a857 100644 --- a/src/gpu/effects/GrShadowGeoProc.cpp +++ b/src/gpu/effects/GrShadowGeoProc.cpp @@ -41,7 +41,6 @@ public: uniformHandler, gpArgs->fPositionVar, rsgp.inPosition()->fName, - rsgp.localMatrix(), args.fFPCoordTransformHandler); fragBuilder->codeAppend("float d = length(shadowParams.xy);"); @@ -55,17 +54,7 @@ public: void setData(const GrGLSLProgramDataManager& pdman, const GrPrimitiveProcessor& proc, FPCoordTransformIter&& transformIter) override { - this->setTransformDataHelper(proc.cast<GrRRectShadowGeoProc>().localMatrix(), - pdman, &transformIter); - } - - static inline void GenKey(const GrGeometryProcessor& gp, - const GrShaderCaps&, - GrProcessorKeyBuilder* b) { - const GrRRectShadowGeoProc& rsgp = gp.cast<GrRRectShadowGeoProc>(); - uint16_t key; - key = rsgp.localMatrix().hasPerspective() ? 0x1 : 0x0; - b->add32(key); + this->setTransformDataHelper(SkMatrix::I(), pdman, &transformIter); } private: @@ -74,9 +63,7 @@ private: /////////////////////////////////////////////////////////////////////////////// -GrRRectShadowGeoProc::GrRRectShadowGeoProc(const SkMatrix& localMatrix) - : fLocalMatrix(localMatrix) { - +GrRRectShadowGeoProc::GrRRectShadowGeoProc() { this->initClassID<GrRRectShadowGeoProc>(); fInPosition = &this->addVertexAttrib("inPosition", kVec2f_GrVertexAttribType, kHigh_GrSLPrecision); @@ -84,11 +71,6 @@ GrRRectShadowGeoProc::GrRRectShadowGeoProc(const SkMatrix& localMatrix) fInShadowParams = &this->addVertexAttrib("inShadowParams", kVec4f_GrVertexAttribType); } -void GrRRectShadowGeoProc::getGLSLProcessorKey(const GrShaderCaps& caps, - GrProcessorKeyBuilder* b) const { - GrGLSLRRectShadowGeoProc::GenKey(*this, caps, b); -} - GrGLSLPrimitiveProcessor* GrRRectShadowGeoProc::createGLSLInstance(const GrShaderCaps&) const { return new GrGLSLRRectShadowGeoProc(); } @@ -99,6 +81,6 @@ GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrRRectShadowGeoProc); #if GR_TEST_UTILS sk_sp<GrGeometryProcessor> GrRRectShadowGeoProc::TestCreate(GrProcessorTestData* d) { - return GrRRectShadowGeoProc::Make(GrTest::TestMatrix(d->fRandom)); + return GrRRectShadowGeoProc::Make(); } #endif diff --git a/src/gpu/effects/GrShadowGeoProc.h b/src/gpu/effects/GrShadowGeoProc.h index d9a1eaf981..0b4baf49b8 100644 --- a/src/gpu/effects/GrShadowGeoProc.h +++ b/src/gpu/effects/GrShadowGeoProc.h @@ -19,29 +19,25 @@ class GrGLRRectShadowGeoProc; */ class GrRRectShadowGeoProc : public GrGeometryProcessor { public: - static sk_sp<GrGeometryProcessor> Make(const SkMatrix& localMatrix) { - return sk_sp<GrGeometryProcessor>(new GrRRectShadowGeoProc(localMatrix)); + static sk_sp<GrGeometryProcessor> Make() { + return sk_sp<GrGeometryProcessor>(new GrRRectShadowGeoProc()); } - ~GrRRectShadowGeoProc() override {} - const char* name() const override { return "RRectShadow"; } const Attribute* inPosition() const { return fInPosition; } const Attribute* inColor() const { return fInColor; } const Attribute* inShadowParams() const { return fInShadowParams; } GrColor color() const { return fColor; } - const SkMatrix& localMatrix() const { return fLocalMatrix; } - void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override; + void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override {} GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override; private: - GrRRectShadowGeoProc(const SkMatrix& localMatrix); + GrRRectShadowGeoProc(); GrColor fColor; - SkMatrix fLocalMatrix; const Attribute* fInPosition; const Attribute* fInColor; const Attribute* fInShadowParams; |