| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |