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

Unified Diff: src/gpu/gl/GrGLGeometryProcessor.h

Issue 827973002: ViewMatrix uniform upload moved to GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@vm-on-gp
Patch Set: more cleanup Created 6 years 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/GrGLGeometryProcessor.h
diff --git a/src/gpu/gl/GrGLGeometryProcessor.h b/src/gpu/gl/GrGLGeometryProcessor.h
index a9f5ead4acf41c6f10154b5e07ae10a56c56cedc..4c9016486c151763e3ffd72a76d0e2ce05c4e021 100644
--- a/src/gpu/gl/GrGLGeometryProcessor.h
+++ b/src/gpu/gl/GrGLGeometryProcessor.h
@@ -20,7 +20,7 @@ class GrGLGPBuilder;
*/
class GrGLGeometryProcessor {
public:
- GrGLGeometryProcessor() {}
+ GrGLGeometryProcessor() : fViewMatrixName(NULL) { fViewMatrix = SkMatrix::InvalidMatrix(); }
virtual ~GrGLGeometryProcessor() {}
typedef GrGLProgramDataManager::UniformHandle UniformHandle;
@@ -74,7 +74,23 @@ protected:
const GrGeometryProcessor::GrAttribute* colorAttr,
UniformHandle* colorUniform);
+ const char* uViewM() const { return fViewMatrixName; }
+
+ /** a helper function to setup the uniform handle for the uniform view matrix */
+ void setupUniformViewMatrix(GrGLGPBuilder*);
+
+
+ /** a helper function to upload a uniform viewmatrix.
+ * TODO we can remove this function when we have deferred geometry in place
+ */
+ void setUniformViewMatrix(const GrGLProgramDataManager&,
+ const SkMatrix& viewMatrix);
+
private:
+ UniformHandle fViewMatrixUniform;
+ SkMatrix fViewMatrix;
+ const char* fViewMatrixName;
+
typedef GrGLProcessor INHERITED;
};

Powered by Google App Engine
This is Rietveld 408576698