aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrShadowGeoProc.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-19 14:33:47 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 20:01:29 +0000
commit92be2f74db81f0ed480b55c58cbde39270f9b772 (patch)
treed2b7135f511a318f10c5c86f2537c07051c922bd /src/gpu/effects/GrShadowGeoProc.h
parentf5ac906476cd26f2967a48340940e6af580fa71f (diff)
Revert "Revert "Change how vertex/instance attributes are handled in geometry processors.""
This reverts commit 5045e501d2aec23e5f1e4b46346033ac3202c6b0. TBR=csmartdalton@google.com Change-Id: Ifbf5f1d8f8ef340fdc69653e931b6d68d4bf0854 Reviewed-on: https://skia-review.googlesource.com/135862 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrShadowGeoProc.h')
-rw-r--r--src/gpu/effects/GrShadowGeoProc.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/gpu/effects/GrShadowGeoProc.h b/src/gpu/effects/GrShadowGeoProc.h
index 0b4baf49b8..df3e501c59 100644
--- a/src/gpu/effects/GrShadowGeoProc.h
+++ b/src/gpu/effects/GrShadowGeoProc.h
@@ -25,9 +25,9 @@ public:
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; }
+ const Attribute& inPosition() const { return kInPosition; }
+ const Attribute& inColor() const { return kInColor; }
+ const Attribute& inShadowParams() const { return kInShadowParams; }
GrColor color() const { return fColor; }
void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override {}
@@ -37,10 +37,15 @@ public:
private:
GrRRectShadowGeoProc();
+ const Attribute& onVertexAttribute(int i) const override {
+ return IthAttribute(i, kInPosition, kInColor, kInShadowParams);
+ }
+
GrColor fColor;
- const Attribute* fInPosition;
- const Attribute* fInColor;
- const Attribute* fInShadowParams;
+
+ static constexpr Attribute kInPosition = {"inPosition", kFloat2_GrVertexAttribType};
+ static constexpr Attribute kInColor = {"inColor", kUByte4_norm_GrVertexAttribType};
+ static constexpr Attribute kInShadowParams = {"inShadowParams", kHalf4_GrVertexAttribType};
GR_DECLARE_GEOMETRY_PROCESSOR_TEST