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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 fHWBoundRenderTarget = NULL; | 364 fHWBoundRenderTarget = NULL; |
365 } | 365 } |
366 | 366 |
367 if (resetBits & kFixedFunction_GrGLBackendState && this->glCaps().fixedFunct
ionSupport()) { | 367 if (resetBits & kFixedFunction_GrGLBackendState && this->glCaps().fixedFunct
ionSupport()) { |
368 | 368 |
369 fHWProjectionMatrixState.invalidate(); | 369 fHWProjectionMatrixState.invalidate(); |
370 // we don't use the model view matrix. | 370 // we don't use the model view matrix. |
371 GL_CALL(MatrixMode(GR_GL_MODELVIEW)); | 371 GL_CALL(MatrixMode(GR_GL_MODELVIEW)); |
372 GL_CALL(LoadIdentity()); | 372 GL_CALL(LoadIdentity()); |
373 | 373 |
374 // When we use fixed function vertex processing we always use the vertex
array | |
375 // and none of the other arrays. | |
376 GL_CALL(EnableClientState(GR_GL_VERTEX_ARRAY)); | |
377 GL_CALL(DisableClientState(GR_GL_NORMAL_ARRAY)); | |
378 GL_CALL(DisableClientState(GR_GL_COLOR_ARRAY)); | |
379 GL_CALL(DisableClientState(GR_GL_INDEX_ARRAY)); | |
380 GL_CALL(DisableClientState(GR_GL_EDGE_FLAG_ARRAY)); | |
381 for (int i = 0; i < this->glCaps().maxFixedFunctionTextureCoords(); ++i)
{ | 374 for (int i = 0; i < this->glCaps().maxFixedFunctionTextureCoords(); ++i)
{ |
382 GL_CALL(ClientActiveTexture(GR_GL_TEXTURE0 + i)); | |
383 GL_CALL(DisableClientState(GR_GL_TEXTURE_COORD_ARRAY)); | |
384 | |
385 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + i)); | 375 GL_CALL(ActiveTexture(GR_GL_TEXTURE0 + i)); |
386 GL_CALL(Disable(GR_GL_TEXTURE_GEN_S)); | 376 GL_CALL(Disable(GR_GL_TEXTURE_GEN_S)); |
387 GL_CALL(Disable(GR_GL_TEXTURE_GEN_T)); | 377 GL_CALL(Disable(GR_GL_TEXTURE_GEN_T)); |
388 GL_CALL(Disable(GR_GL_TEXTURE_GEN_Q)); | 378 GL_CALL(Disable(GR_GL_TEXTURE_GEN_Q)); |
389 GL_CALL(Disable(GR_GL_TEXTURE_GEN_R)); | 379 GL_CALL(Disable(GR_GL_TEXTURE_GEN_R)); |
390 } | 380 } |
391 } | 381 } |
392 | 382 |
393 // we assume these values | 383 // we assume these values |
394 if (resetBits & kPixelStore_GrGLBackendState) { | 384 if (resetBits & kPixelStore_GrGLBackendState) { |
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 this->setVertexArrayID(gpu, 0); | 2588 this->setVertexArrayID(gpu, 0); |
2599 } | 2589 } |
2600 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2590 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2601 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2591 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2602 fDefaultVertexArrayAttribState.resize(attrCount); | 2592 fDefaultVertexArrayAttribState.resize(attrCount); |
2603 } | 2593 } |
2604 attribState = &fDefaultVertexArrayAttribState; | 2594 attribState = &fDefaultVertexArrayAttribState; |
2605 } | 2595 } |
2606 return attribState; | 2596 return attribState; |
2607 } | 2597 } |
OLD | NEW |