aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-12-12 09:48:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-12 15:24:09 +0000
commite7e81c15c144b8133f696d0744ed9f7e8d06e936 (patch)
treea8b97c5e3ee2dea146a9cedbff3a33356a181180 /src/gpu/gl
parent344e9037e1befdee76691a1239a47829e6af4ea5 (diff)
converted vertex shaders to device coords
Bug: skia:6239 Change-Id: I1a3b67fe84d208d426d71deb7aea6b0cd433af37 Reviewed-on: https://skia-review.googlesource.com/75501 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLUniformHandler.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLUniformHandler.cpp b/src/gpu/gl/GrGLUniformHandler.cpp
index b3b4b9f6b5..39392f996b 100644
--- a/src/gpu/gl/GrGLUniformHandler.cpp
+++ b/src/gpu/gl/GrGLUniformHandler.cpp
@@ -10,10 +10,19 @@
#include "gl/GrGLCaps.h"
#include "gl/GrGLGpu.h"
#include "gl/builders/GrGLProgramBuilder.h"
+#include "SkSLCompiler.h"
#define GL_CALL(X) GR_GL_CALL(this->glGpu()->glInterface(), X)
#define GL_CALL_RET(R, X) GR_GL_CALL_RET(this->glGpu()->glInterface(), R, X)
+bool valid_name(const char* name) {
+ // disallow unknown names that start with "sk_"
+ if (!strncmp(name, GR_NO_MANGLE_PREFIX, strlen(GR_NO_MANGLE_PREFIX))) {
+ return !strcmp(name, SkSL::Compiler::RTADJUST_NAME);
+ }
+ return true;
+}
+
GrGLSLUniformHandler::UniformHandle GrGLUniformHandler::internalAddUniformArray(
uint32_t visibility,
GrSLType type,
@@ -23,6 +32,7 @@ GrGLSLUniformHandler::UniformHandle GrGLUniformHandler::internalAddUniformArray(
int arrayCount,
const char** outName) {
SkASSERT(name && strlen(name));
+ SkASSERT(valid_name(name));
SkASSERT(0 != visibility);
SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeTemporarilyAcceptsPrecision(type));
@@ -36,7 +46,7 @@ GrGLSLUniformHandler::UniformHandle GrGLUniformHandler::internalAddUniformArray(
// uniform view matrix, they should upload the view matrix in their setData along with regular
// uniforms.
char prefix = 'u';
- if ('u' == name[0]) {
+ if ('u' == name[0] || !strncmp(name, GR_NO_MANGLE_PREFIX, strlen(GR_NO_MANGLE_PREFIX))) {
prefix = '\0';
}
fProgramBuilder->nameVariable(uni.fVariable.accessName(), prefix, name, mangleName);