Tracking uniform ownership
This is a prerequisite change for the upcoming sample(child, matrix)
function. By itself, this CL doesn't really change anything; it just
adds an ownership tracking feature which sample(child, matrix) depends
on.
Change-Id: I98b12e5fb062a2535af367931e7a932ea9c63a59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281337
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
index aaefa8e..142f3c7 100644
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
@@ -97,7 +97,8 @@
uni.fType = kFloat3x3_GrSLType;
}
uni.fHandle =
- uniformHandler->addUniform(flag, uni.fType, strUniName.c_str(), &matrixName);
+ uniformHandler->addUniform(&fp, flag, uni.fType, strUniName.c_str(),
+ &matrixName);
transformVar = uniformHandler->getUniformVariable(uni.fHandle);
} else {
// Install a coord transform that will be skipped.
@@ -181,7 +182,8 @@
vertBuilder->codeAppendf("float2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
} else {
const char* viewMatrixName;
- *viewMatrixUniform = uniformHandler->addUniform(kVertex_GrShaderFlag,
+ *viewMatrixUniform = uniformHandler->addUniform(nullptr,
+ kVertex_GrShaderFlag,
kFloat3x3_GrSLType,
"uViewM",
&viewMatrixName);