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 #include "GrGpuGL.h" | 9 #include "GrGpuGL.h" |
10 #include "GrGLStencilBuffer.h" | 10 #include "GrGLStencilBuffer.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 | 298 |
299 if (resetBits & kRenderTarget_GrGLBackendState) { | 299 if (resetBits & kRenderTarget_GrGLBackendState) { |
300 fHWBoundRenderTarget = NULL; | 300 fHWBoundRenderTarget = NULL; |
301 } | 301 } |
302 | 302 |
303 if (resetBits & kPathRendering_GrGLBackendState) { | 303 if (resetBits & kPathRendering_GrGLBackendState) { |
304 if (this->caps()->pathRenderingSupport()) { | 304 if (this->caps()->pathRenderingSupport()) { |
305 fHWProjectionMatrixState.invalidate(); | 305 fHWProjectionMatrixState.invalidate(); |
306 // we don't use the model view matrix. | 306 // we don't use the model view matrix. |
307 GL_CALL(MatrixMode(GR_GL_MODELVIEW)); | 307 GL_CALL(MatrixLoadIdentity(GR_GL_MODELVIEW)); |
308 GL_CALL(LoadIdentity()); | |
309 | 308 |
310 for (int i = 0; i < this->glCaps().maxFixedFunctionTextureCoords();
++i) { | 309 for (int i = 0; i < this->glCaps().maxFixedFunctionTextureCoords();
++i) { |
311 GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL)); | 310 GL_CALL(PathTexGen(GR_GL_TEXTURE0 + i, GR_GL_NONE, 0, NULL)); |
312 fHWPathTexGenSettings[i].fMode = GR_GL_NONE; | 311 fHWPathTexGenSettings[i].fMode = GR_GL_NONE; |
313 fHWPathTexGenSettings[i].fNumComponents = 0; | 312 fHWPathTexGenSettings[i].fNumComponents = 0; |
314 } | 313 } |
315 fHWActivePathTexGenSets = 0; | 314 fHWActivePathTexGenSets = 0; |
316 } | 315 } |
317 fHWPathStencilSettings.invalidate(); | 316 fHWPathStencilSettings.invalidate(); |
318 } | 317 } |
(...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 matrix.cheapEqualTo(fHWProjectionMatrixState.fViewMatrix)) { | 2227 matrix.cheapEqualTo(fHWProjectionMatrixState.fViewMatrix)) { |
2229 return; | 2228 return; |
2230 } | 2229 } |
2231 | 2230 |
2232 fHWProjectionMatrixState.fViewMatrix = matrix; | 2231 fHWProjectionMatrixState.fViewMatrix = matrix; |
2233 fHWProjectionMatrixState.fRenderTargetSize = renderTargetSize; | 2232 fHWProjectionMatrixState.fRenderTargetSize = renderTargetSize; |
2234 fHWProjectionMatrixState.fRenderTargetOrigin = renderTargetOrigin; | 2233 fHWProjectionMatrixState.fRenderTargetOrigin = renderTargetOrigin; |
2235 | 2234 |
2236 GrGLfloat glMatrix[4 * 4]; | 2235 GrGLfloat glMatrix[4 * 4]; |
2237 fHWProjectionMatrixState.getGLMatrix<4>(glMatrix); | 2236 fHWProjectionMatrixState.getGLMatrix<4>(glMatrix); |
2238 GL_CALL(MatrixMode(GR_GL_PROJECTION)); | 2237 GL_CALL(MatrixLoadf(GR_GL_PROJECTION, glMatrix)); |
2239 GL_CALL(LoadMatrixf(glMatrix)); | |
2240 } | 2238 } |
2241 | 2239 |
2242 void GrGpuGL::enablePathTexGen(int unitIdx, | 2240 void GrGpuGL::enablePathTexGen(int unitIdx, |
2243 PathTexGenComponents components, | 2241 PathTexGenComponents components, |
2244 const GrGLfloat* coefficients) { | 2242 const GrGLfloat* coefficients) { |
2245 SkASSERT(this->glCaps().pathRenderingSupport()); | 2243 SkASSERT(this->glCaps().pathRenderingSupport()); |
2246 SkASSERT(components >= kS_PathTexGenComponents && | 2244 SkASSERT(components >= kS_PathTexGenComponents && |
2247 components <= kSTR_PathTexGenComponents); | 2245 components <= kSTR_PathTexGenComponents); |
2248 SkASSERT(this->glCaps().maxFixedFunctionTextureCoords() >= unitIdx); | 2246 SkASSERT(this->glCaps().maxFixedFunctionTextureCoords() >= unitIdx); |
2249 | 2247 |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2805 this->setVertexArrayID(gpu, 0); | 2803 this->setVertexArrayID(gpu, 0); |
2806 } | 2804 } |
2807 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2805 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2808 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2806 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2809 fDefaultVertexArrayAttribState.resize(attrCount); | 2807 fDefaultVertexArrayAttribState.resize(attrCount); |
2810 } | 2808 } |
2811 attribState = &fDefaultVertexArrayAttribState; | 2809 attribState = &fDefaultVertexArrayAttribState; |
2812 } | 2810 } |
2813 return attribState; | 2811 return attribState; |
2814 } | 2812 } |
OLD | NEW |