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

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

Issue 1336763003: remove path specific program building classes (Closed) Base URL: https://skia.googlesource.com/skia.git@pathgp
Patch Set: a few more tidys Created 5 years, 3 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
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.h ('k') | src/gpu/gl/builders/GrGLPathProgramBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDataManager.cpp
diff --git a/src/gpu/gl/GrGLProgramDataManager.cpp b/src/gpu/gl/GrGLProgramDataManager.cpp
index ed497bd1926b09343f1e761d1a6df648118ac3ae..4d5d711de48715bf8d8b184711f81d1cdfb9d0c1 100644
--- a/src/gpu/gl/GrGLProgramDataManager.cpp
+++ b/src/gpu/gl/GrGLProgramDataManager.cpp
@@ -13,8 +13,11 @@
SkASSERT(arrayCount <= uni.fArrayCount || \
(1 == arrayCount && GrGLShaderVar::kNonArray == uni.fArrayCount))
-GrGLProgramDataManager::GrGLProgramDataManager(GrGLGpu* gpu, const UniformInfoArray& uniforms)
- : fGpu(gpu) {
+GrGLProgramDataManager::GrGLProgramDataManager(GrGLGpu* gpu, GrGLuint programID,
+ const UniformInfoArray& uniforms,
+ const SeparableVaryingInfoArray& separableVaryings)
+ : fGpu(gpu)
+ , fProgramID(programID) {
int count = uniforms.count();
fUniforms.push_back_n(count);
for (int i = 0; i < count; i++) {
@@ -39,6 +42,22 @@ GrGLProgramDataManager::GrGLProgramDataManager(GrGLGpu* gpu, const UniformInfoAr
uniform.fFSLocation = kUnusedUniform;
}
}
+
+ // NVPR programs have separable varyings
+ count = separableVaryings.count();
+ fSeparableVaryings.push_back_n(count);
+ for (int i = 0; i < count; i++) {
+ SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport());
+ SeparableVarying& separableVarying = fSeparableVaryings[i];
+ const SeparableVaryingInfo& builderSeparableVarying = separableVaryings[i];
+ SkASSERT(GrGLShaderVar::kNonArray == builderSeparableVarying.fVariable.getArrayCount() ||
+ builderSeparableVarying.fVariable.getArrayCount() > 0);
+ SkDEBUGCODE(
+ separableVarying.fArrayCount = builderSeparableVarying.fVariable.getArrayCount();
+ separableVarying.fType = builderSeparableVarying.fVariable.getType();
+ );
+ separableVarying.fLocation = builderSeparableVarying.fLocation;
+ }
}
void GrGLProgramDataManager::setSampler(UniformHandle u, GrGLint texUnit) const {
@@ -257,6 +276,22 @@ void GrGLProgramDataManager::setSkMatrix(UniformHandle u, const SkMatrix& matrix
this->setMatrix3f(u, mt);
}
+void GrGLProgramDataManager::setPathFragmentInputTransform(SeparableVaryingHandle u,
+ int components,
+ const SkMatrix& matrix) const {
+ SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport());
+ const SeparableVarying& fragmentInput = fSeparableVaryings[u.toIndex()];
+
+ SkASSERT((components == 2 && fragmentInput.fType == kVec2f_GrSLType) ||
+ (components == 3 && fragmentInput.fType == kVec3f_GrSLType));
+
+ fGpu->glPathRendering()->setProgramPathFragmentInputTransform(fProgramID,
+ fragmentInput.fLocation,
+ GR_GL_OBJECT_LINEAR,
+ components,
+ matrix);
+}
+
#ifdef SK_DEBUG
void GrGLProgramDataManager::printUnused(const Uniform& uni) const {
if (kUnusedUniform == uni.fFSLocation && kUnusedUniform == uni.fVSLocation) {
« no previous file with comments | « src/gpu/gl/GrGLProgramDataManager.h ('k') | src/gpu/gl/builders/GrGLPathProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698