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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 | 357 |
358 // Vertex | 358 // Vertex |
359 if (resetBits & kVertex_GrGLBackendState) { | 359 if (resetBits & kVertex_GrGLBackendState) { |
360 fHWGeometryState.invalidate(); | 360 fHWGeometryState.invalidate(); |
361 } | 361 } |
362 | 362 |
363 if (resetBits & kRenderTarget_GrGLBackendState) { | 363 if (resetBits & kRenderTarget_GrGLBackendState) { |
364 fHWBoundRenderTarget = NULL; | 364 fHWBoundRenderTarget = NULL; |
365 } | 365 } |
366 | 366 |
367 if (resetBits & kFixedFunction_GrGLBackendState && | 367 if (resetBits & kFixedFunction_GrGLBackendState && this->glCaps().fixedFunct
ionSupport()) { |
368 kDesktop_GrGLBinding == this->glBinding() && | |
369 !this->glCaps().isCoreProfile()) { | |
370 | 368 |
371 fHWProjectionMatrixState.invalidate(); | 369 fHWProjectionMatrixState.invalidate(); |
372 // we don't use the model view matrix. | 370 // we don't use the model view matrix. |
373 GL_CALL(MatrixMode(GR_GL_MODELVIEW)); | 371 GL_CALL(MatrixMode(GR_GL_MODELVIEW)); |
374 GL_CALL(LoadIdentity()); | 372 GL_CALL(LoadIdentity()); |
375 | 373 |
376 // When we use fixed function vertex processing we always use the vertex
array | 374 // When we use fixed function vertex processing we always use the vertex
array |
377 // and none of the other arrays. | 375 // and none of the other arrays. |
378 GL_CALL(EnableClientState(GR_GL_VERTEX_ARRAY)); | 376 GL_CALL(EnableClientState(GR_GL_VERTEX_ARRAY)); |
379 GL_CALL(DisableClientState(GR_GL_NORMAL_ARRAY)); | 377 GL_CALL(DisableClientState(GR_GL_NORMAL_ARRAY)); |
(...skipping 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2580 this->setVertexArrayID(gpu, 0); | 2578 this->setVertexArrayID(gpu, 0); |
2581 } | 2579 } |
2582 int attrCount = gpu->glCaps().maxVertexAttributes(); | 2580 int attrCount = gpu->glCaps().maxVertexAttributes(); |
2583 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 2581 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
2584 fDefaultVertexArrayAttribState.resize(attrCount); | 2582 fDefaultVertexArrayAttribState.resize(attrCount); |
2585 } | 2583 } |
2586 attribState = &fDefaultVertexArrayAttribState; | 2584 attribState = &fDefaultVertexArrayAttribState; |
2587 } | 2585 } |
2588 return attribState; | 2586 return attribState; |
2589 } | 2587 } |
OLD | NEW |