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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 SkMatrix combined; | 107 SkMatrix combined; |
108 if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) { | 108 if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) { |
109 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0,
-SK_Scalar1, | 109 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0,
-SK_Scalar1, |
110 0, -SkIntToScalar(2) / fRenderTargetSize.fHeight
, SK_Scalar1, | 110 0, -SkIntToScalar(2) / fRenderTargetSize.fHeight
, SK_Scalar1, |
111 0, 0, SkMatrix::I()[8]); | 111 0, 0, SkMatrix::I()[8]); |
112 } else { | 112 } else { |
113 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0,
-SK_Scalar1, | 113 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0,
-SK_Scalar1, |
114 0, SkIntToScalar(2) / fRenderTargetSize.fHeight,
-SK_Scalar1, | 114 0, SkIntToScalar(2) / fRenderTargetSize.fHeight,
-SK_Scalar1, |
115 0, 0, SkMatrix::I()[8]); | 115 0, 0, SkMatrix::I()[8]); |
116 } | 116 } |
117 combined.setConcat(combined, fViewMatrix); | 117 combined.preConcat(fViewMatrix); |
118 GrGLGetMatrix<Size>(destMatrix, combined); | 118 GrGLGetMatrix<Size>(destMatrix, combined); |
119 } | 119 } |
120 }; | 120 }; |
121 | 121 |
122 /** | 122 /** |
123 * This function uploads uniforms and calls each GrGLEffect's setData. It is
called before a | 123 * This function uploads uniforms and calls each GrGLEffect's setData. It is
called before a |
124 * draw occurs using the program after the program has already been bound. I
t also uses the | 124 * draw occurs using the program after the program has already been bound. I
t also uses the |
125 * GrGpuGL object to bind the textures required by the GrGLEffects. The colo
r and coverage | 125 * GrGpuGL object to bind the textures required by the GrGLEffects. The colo
r and coverage |
126 * stages come from GrGLProgramDesc::Build(). | 126 * stages come from GrGLProgramDesc::Build(). |
127 */ | 127 */ |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 GrGLUniformManager fUniformManager; | 197 GrGLUniformManager fUniformManager; |
198 UniformHandles fUniformHandles; | 198 UniformHandles fUniformHandles; |
199 | 199 |
200 bool fHasVertexShader; | 200 bool fHasVertexShader; |
201 int fNumTexCoordSets; | 201 int fNumTexCoordSets; |
202 | 202 |
203 typedef SkRefCnt INHERITED; | 203 typedef SkRefCnt INHERITED; |
204 }; | 204 }; |
205 | 205 |
206 #endif | 206 #endif |
OLD | NEW |