diff options
author | 2016-11-22 15:06:46 -0500 | |
---|---|---|
committer | 2016-11-22 20:49:02 +0000 | |
commit | 60397689631d74ea51892487456849c57b5364f3 (patch) | |
tree | f902ca7339f67ae0c5246f360afaa6a027aeca60 /include/gpu/GrShaderVar.h | |
parent | cb5338cadcc7852026a5225f8cf825530f265fa2 (diff) |
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 <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/gpu/GrShaderVar.h')
-rw-r--r-- | include/gpu/GrShaderVar.h | 13 |
1 files changed, 10 insertions, 3 deletions
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) { |