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

Side by Side Diff: src/gpu/gl/GrGLProgram.h

Issue 13296005: Revise attribute binding interface (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fix fExperimentalGS in GrGLProgramDesc Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrTextContext.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef GrGLProgram_DEFINED 9 #ifndef GrGLProgram_DEFINED
10 #define GrGLProgram_DEFINED 10 #define GrGLProgram_DEFINED
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void overrideBlend(GrBlendCoeff* srcCoeff, GrBlendCoeff* dstCoeff) const; 53 void overrideBlend(GrBlendCoeff* srcCoeff, GrBlendCoeff* dstCoeff) const;
54 54
55 const GrGLProgramDesc& getDesc() { return fDesc; } 55 const GrGLProgramDesc& getDesc() { return fDesc; }
56 56
57 /** 57 /**
58 * Gets the GL program ID for this program. 58 * Gets the GL program ID for this program.
59 */ 59 */
60 GrGLuint programID() const { return fProgramID; } 60 GrGLuint programID() const { return fProgramID; }
61 61
62 /** 62 /**
63 * Some GL state that is relevant to programs is not stored per-program. In particular vertex 63 * Some GL state that is relevant to programs is not stored per-program. In particular color
64 * attributes are global state. This struct is read and updated by GrGLProgr am::setData to 64 * and coverage attributes can be global state. This struct is read and upda ted by
65 * allow us to avoid setting this state redundantly. 65 * GrGLProgram::setColor and GrGLProgram::setCoverage to allow us to avoid s etting this state
66 * redundantly.
66 */ 67 */
67 struct SharedGLState { 68 struct SharedGLState {
68 GrColor fConstAttribColor; 69 GrColor fConstAttribColor;
70 int fConstAttribColorIndex;
69 GrColor fConstAttribCoverage; 71 GrColor fConstAttribCoverage;
72 int fConstAttribCoverageIndex;
70 73
71 SharedGLState() { this->invalidate(); } 74 SharedGLState() { this->invalidate(); }
72 void invalidate() { 75 void invalidate() {
73 fConstAttribColor = GrColor_ILLEGAL; 76 fConstAttribColor = GrColor_ILLEGAL;
77 fConstAttribColorIndex = -1;
74 fConstAttribCoverage = GrColor_ILLEGAL; 78 fConstAttribCoverage = GrColor_ILLEGAL;
79 fConstAttribCoverageIndex = -1;
75 } 80 }
76 }; 81 };
77 82
78 /** 83 /**
79 * The GrDrawState's view matrix along with the aspects of the render target determine the 84 * The GrDrawState's view matrix along with the aspects of the render target determine the
80 * matrix sent to GL. The size of the render target affects the GL matrix be cause we must 85 * matrix sent to GL. The size of the render target affects the GL matrix be cause we must
81 * convert from Skia device coords to GL's normalized coords. Also the origi n of the render 86 * convert from Skia device coords to GL's normalized coords. Also the origi n of the render
82 * target may require us to perform a mirror-flip. 87 * target may require us to perform a mirror-flip.
83 */ 88 */
84 struct MatrixState { 89 struct MatrixState {
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 GrGLProgramDesc fDesc; 205 GrGLProgramDesc fDesc;
201 const GrGLContext& fContext; 206 const GrGLContext& fContext;
202 207
203 GrGLUniformManager fUniformManager; 208 GrGLUniformManager fUniformManager;
204 UniformHandles fUniformHandles; 209 UniformHandles fUniformHandles;
205 210
206 typedef GrRefCnt INHERITED; 211 typedef GrRefCnt INHERITED;
207 }; 212 };
208 213
209 #endif 214 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTextContext.cpp ('k') | src/gpu/gl/GrGLProgram.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698