| Index: src/gpu/gl/GrGLProgramDataManager.cpp
|
| diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
|
| index f8d996b542e0cd8c11f33dd27bebb5fc73f67a4e..c53abd79abe3a3774129c8aff17b75201e556a19 100644
|
| --- a/src/gpu/gl/GrGLProgramDataManager.cpp
|
| +++ b/src/gpu/gl/GrGLProgramDataManager.cpp
|
| @@ -5,7 +5,9 @@
|
| * found in the LICENSE file.
|
| */
|
|
|
| +#include "gl/builders/GrGLProgramBuilder.h"
|
| #include "gl/GrGLPathRendering.h"
|
| +#include "gl/GrGLProgram.h"
|
| #include "gl/GrGLUniformHandle.h"
|
| #include "gl/GrGpuGL.h"
|
| #include "SkMatrix.h"
|
| @@ -14,13 +16,16 @@
|
| SkASSERT(arrayCount <= uni.fArrayCount || \
|
| (1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
|
|
|
| -GrGLProgramDataManager::GrGLProgramDataManager(GrGpuGL* gpu, const UniformInfoArray& uniforms)
|
| - : fGpu(gpu) {
|
| - int count = uniforms.count();
|
| +GrGLProgramDataManager::GrGLProgramDataManager(GrGpuGL* gpu,
|
| + GrGLProgram* program,
|
| + const GrGLProgramBuilder& builder)
|
| + : fGpu(gpu),
|
| + fProgram(program) {
|
| + int count = builder.getUniformInfos().count();
|
| fUniforms.push_back_n(count);
|
| for (int i = 0; i < count; i++) {
|
| Uniform& uniform = fUniforms[i];
|
| - const UniformInfo& builderUniform = uniforms[i];
|
| + const GrGLProgramBuilder::UniformInfo& builderUniform = builder.getUniformInfos()[i];
|
| SkASSERT(GrGLShaderVar::kNonArray == builderUniform.fVariable.getArrayCount() ||
|
| builderUniform.fVariable.getArrayCount() > 0);
|
| SkDEBUGCODE(
|
| @@ -33,12 +38,25 @@
|
| uniform.fVSLocation = builderUniform.fLocation;
|
| } else {
|
| uniform.fVSLocation = kUnusedUniform;
|
| - }
|
| + }
|
| if (GrGLProgramBuilder::kFragment_Visibility & builderUniform.fVisibility) {
|
| uniform.fFSLocation = builderUniform.fLocation;
|
| } else {
|
| 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;
|
| }
|
| }
|
|
|
| @@ -258,3 +276,14 @@
|
| };
|
| 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);
|
| +}
|
|
|