From 92be2f74db81f0ed480b55c58cbde39270f9b772 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Tue, 19 Jun 2018 14:33:47 -0400 Subject: 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 Commit-Queue: Brian Salomon --- src/gpu/effects/GrShadowGeoProc.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/gpu/effects/GrShadowGeoProc.h') 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 -- cgit v1.2.3