From 60397689631d74ea51892487456849c57b5364f3 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Tue, 22 Nov 2016 15:06:46 -0500 Subject: Move GrShaderVar to an appending model for layout qualifiers GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5144 Change-Id: I05e88961e50bd679cfe5863f413f3ec65bc9fd95 Reviewed-on: https://skia-review.googlesource.com/5144 Reviewed-by: Greg Daniel Reviewed-by: Chris Dalton Commit-Queue: Brian Salomon --- include/gpu/GrShaderVar.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/gpu/GrShaderVar.h') diff --git a/include/gpu/GrShaderVar.h b/include/gpu/GrShaderVar.h index 81a7566a9d..aaae107c19 100644 --- a/include/gpu/GrShaderVar.h +++ b/include/gpu/GrShaderVar.h @@ -271,10 +271,17 @@ public: void setPrecision(GrSLPrecision p) { fPrecision = p; } /** - * Set the layout qualifier + * Appends to the layout qualifier */ - void setLayoutQualifier(const char* layoutQualifier) { - fLayoutQualifier = layoutQualifier; + void addLayoutQualifier(const char* layoutQualifier) { + if (!layoutQualifier || !strlen(layoutQualifier)) { + return; + } + if (fLayoutQualifier.isEmpty()) { + fLayoutQualifier = layoutQualifier; + } else { + fLayoutQualifier.appendf(", %s", layoutQualifier); + } } void addModifier(const char* modifier) { -- cgit v1.2.3