Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 23542013: Improve handling of FF vertex array state (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rob's comments and add secondary color array disable Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698