Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Unified Diff: src/gpu/gl/GrGLProgramDataManager.cpp

Issue 367643004: Implement NVPR on GLES (Closed) Base URL: https://skia.googlesource.com/skia.git@02-path-program-fragment
Patch Set: rebse Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLProgramDataManager.cpp
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index eed9d1935db619eeb5ccc4eae4fd1596cbfd9b1e..c53abd79abe3a3774129c8aff17b75201e556a19 100644
--- a/src/gpu/gl/GrGLProgramDataManager.cpp
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp
@@ -6,6 +6,7 @@
*/
#include "gl/builders/GrGLProgramBuilder.h"
+#include "gl/GrGLPathRendering.h"
#include "gl/GrGLProgram.h"
#include "gl/GrGLUniformHandle.h"
#include "gl/GrGpuGL.h"
@@ -16,9 +17,10 @@
(1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
GrGLProgramDataManager::GrGLProgramDataManager(GrGpuGL* gpu,
- GrGLProgram*,
+ GrGLProgram* program,
const GrGLProgramBuilder& builder)
- : fGpu(gpu) {
+ : fGpu(gpu),
+ fProgram(program) {
int count = builder.getUniformInfos().count();
fUniforms.push_back_n(count);
for (int i = 0; i < count; i++) {
@@ -43,6 +45,19 @@ GrGLProgramDataManager::GrGLProgramDataManager(GrGpuGL* gpu,
uniform.fFSLocation = kUnusedUniform;
}
}
+
+ count = builder.getSeparableVaryingInfos().count();
+ fVaryings.push_back_n(count);
+ for (int i = 0; i < count; i++) {
+ Varying& varying = fVaryings[i];
+ const GrGLProgramBuilder::SeparableVaryingInfo& builderVarying =
+ builder.getSeparableVaryingInfos()[i];
+ SkASSERT(GrGLShaderVar::kNonArray == builderVarying.fVariable.getArrayCount());
+ SkDEBUGCODE(
+ varying.fType = builderVarying.fVariable.getType();
+ );
+ varying.fLocation = builderVarying.fLocation;
+ }
}
void GrGLProgramDataManager::setSampler(UniformHandle u, GrGLint texUnit) const {
@@ -261,3 +276,14 @@ void GrGLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix
};
this->setMatrix3f(u, mt);
}
+
+void GrGLProgramDataManager::setProgramPathFragmentInputTransform(VaryingHandle i,
+ unsigned components,
+ const SkMatrix& matrix) const {
+ const Varying& fragmentInput = fVaryings[i.toProgramDataIndex()];
+ fGpu->glPathRendering()->setProgramPathFragmentInputTransform(fProgram->programID(),
+ fragmentInput.fLocation,
+ GR_GL_OBJECT_LINEAR,
+ components,
+ matrix);
+}

Powered by Google App Engine
This is Rietveld 408576698