diff options
author | 2014-12-30 09:04:15 -0800 | |
---|---|---|
committer | 2014-12-30 09:04:16 -0800 | |
commit | ee2af95db72152dfa61c841875df0594ca93437d (patch) | |
tree | 21f811f95923d1c916e57d1742c2dc4751d067fd /src/gpu/gl/GrGLGeometryProcessor.h | |
parent | 78aea9f75248dbfeac8d653fbd0bc37d568ec2f2 (diff) |
ViewMatrix uniform upload moved to GeometryProcessor
BUG=skia:
Review URL: https://codereview.chromium.org/827973002
Diffstat (limited to 'src/gpu/gl/GrGLGeometryProcessor.h')
-rw-r--r-- | src/gpu/gl/GrGLGeometryProcessor.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gpu/gl/GrGLGeometryProcessor.h b/src/gpu/gl/GrGLGeometryProcessor.h index a9f5ead4ac..0b24144d84 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 addUniformViewMatrix(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; }; |