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

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

Issue 1186113007: Refactor separable varying location info to be stored in GrGLProgram subclass (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comments Created 5 years, 6 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/GrGLPathProgramDataManager.h ('k') | src/gpu/gl/GrGLPrimitiveProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPathProgramDataManager.cpp
diff --git a/src/gpu/gl/GrGLPathProgramDataManager.cpp b/src/gpu/gl/GrGLPathProgramDataManager.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f165015a210cab559daf9a8992845df379ccf75a
--- /dev/null
+++ b/src/gpu/gl/GrGLPathProgramDataManager.cpp
@@ -0,0 +1,48 @@
+ /*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gl/GrGLPathProgramDataManager.h"
+#include "gl/GrGLPathRendering.h"
+#include "gl/GrGLUniformHandle.h"
+#include "gl/GrGLGpu.h"
+#include "SkMatrix.h"
+
+GrGLPathProgramDataManager::GrGLPathProgramDataManager(
+ GrGLGpu* gpu, GrGLuint programID, const SeparableVaryingInfoArray& separableVaryings)
+ : fGpu(gpu)
+ , fProgramID(programID) {
+ int count = separableVaryings.count();
+ fSeparableVaryings.push_back_n(count);
+ for (int i = 0; i < count; i++) {
+ 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 GrGLPathProgramDataManager::setPathFragmentInputTransform(SeparableVaryingHandle u,
+ int components,
+ const SkMatrix& matrix) const {
+ const SeparableVarying& fragmentInput =
+ fSeparableVaryings[u.toProgramDataIndex()];
+
+ 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);
+}
+
« no previous file with comments | « src/gpu/gl/GrGLPathProgramDataManager.h ('k') | src/gpu/gl/GrGLPrimitiveProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698