diff options
author | 2014-10-27 15:33:33 -0700 | |
---|---|---|
committer | 2014-10-27 15:33:33 -0700 | |
commit | 84c94c0dfd1e12e97d8a835882dda575f36e41d2 (patch) | |
tree | 7992422b87bb7f3997c4525b3d21dc342b4ce2d4 /src/gpu/gl/GrGLProgram.h | |
parent | 76993edbe5dbbde07a843507184abf90c64d9928 (diff) |
Working patch to remove constant attributes. This may cause some gm mismatches, I will rebaseline tonight.
BUG=skia:
Review URL: https://codereview.chromium.org/678073005
Diffstat (limited to 'src/gpu/gl/GrGLProgram.h')
-rw-r--r-- | src/gpu/gl/GrGLProgram.h | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h index e8aef35f1d..ca75e206f1 100644 --- a/src/gpu/gl/GrGLProgram.h +++ b/src/gpu/gl/GrGLProgram.h @@ -60,27 +60,6 @@ public: virtual bool hasVertexShader() const { return true; } /** - * Some GL state that is relevant to programs is not stored per-program. In particular color - * and coverage attributes can be global state. This struct is read and updated by - * GrGLProgram::setColor and GrGLProgram::setCoverage to allow us to avoid setting this state - * redundantly. - */ - struct SharedGLState { - GrColor fConstAttribColor; - int fConstAttribColorIndex; - GrColor fConstAttribCoverage; - int fConstAttribCoverageIndex; - - SharedGLState() { this->invalidate(); } - void invalidate() { - fConstAttribColor = GrColor_ILLEGAL; - fConstAttribColorIndex = -1; - fConstAttribCoverage = GrColor_ILLEGAL; - fConstAttribCoverageIndex = -1; - } - }; - - /** * The GrDrawState's view matrix along with the aspects of the render target determine the * matrix sent to GL. The size of the render target affects the GL matrix because we must * convert from Skia device coords to GL's normalized coords. Also the origin of the render @@ -152,8 +131,7 @@ public: */ void setData(const GrOptDrawState&, GrGpu::DrawType, - const GrDeviceCoordTexture* dstCopy, // can be NULL - SharedGLState*); + const GrDeviceCoordTexture* dstCopy /* can be NULL*/); protected: typedef GrGLProgramDataManager::UniformHandle UniformHandle; @@ -173,11 +151,11 @@ protected: // Helper for setData(). Makes GL calls to specify the initial color when there is not // per-vertex colors. - void setColor(const GrOptDrawState&, GrColor color, SharedGLState*); + void setColor(const GrOptDrawState&, GrColor color); // Helper for setData(). Makes GL calls to specify the initial coverage when there is not // per-vertex coverages. - void setCoverage(const GrOptDrawState&, GrColor coverage, SharedGLState*); + void setCoverage(const GrOptDrawState&, GrColor coverage); // A templated helper to loop over effects, set the transforms(via subclass) and bind textures void setFragmentData(const GrOptDrawState&); |