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

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

Issue 375823005: Remove gpu shader optimatization for solid white or trans black colors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change ignore function name Created 6 years, 5 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
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | tests/GLProgramsTest.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 #include "GrGpuGL.h" 8 #include "GrGpuGL.h"
9 9
10 #include "GrEffect.h" 10 #include "GrEffect.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 *indexOffsetInBytes += ibuf->baseOffset(); 346 *indexOffsetInBytes += ibuf->baseOffset();
347 } 347 }
348 GrGLAttribArrayState* attribState = 348 GrGLAttribArrayState* attribState =
349 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf); 349 fHWGeometryState.bindArrayAndBuffersToDraw(this, vbuf, ibuf);
350 350
351 if (fCurrentProgram->hasVertexShader()) { 351 if (fCurrentProgram->hasVertexShader()) {
352 int vertexAttribCount = this->getDrawState().getVertexAttribCount(); 352 int vertexAttribCount = this->getDrawState().getVertexAttribCount();
353 uint32_t usedAttribArraysMask = 0; 353 uint32_t usedAttribArraysMask = 0;
354 const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttri bs(); 354 const GrVertexAttrib* vertexAttrib = this->getDrawState().getVertexAttri bs();
355 355
356 bool canIgnoreColorAttrib = this->getDrawState().canIgnoreColorAttribute ();
357
356 for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount; 358 for (int vertexAttribIndex = 0; vertexAttribIndex < vertexAttribCount;
357 ++vertexAttribIndex, ++vertexAttrib) { 359 ++vertexAttribIndex, ++vertexAttrib) {
358 360
361 if (kColor_GrVertexAttribBinding != vertexAttrib->fBinding || !canIg noreColorAttrib) {
359 usedAttribArraysMask |= (1 << vertexAttribIndex); 362 usedAttribArraysMask |= (1 << vertexAttribIndex);
360 GrVertexAttribType attribType = vertexAttrib->fType; 363 GrVertexAttribType attribType = vertexAttrib->fType;
361 attribState->set(this, 364 attribState->set(this,
362 vertexAttribIndex, 365 vertexAttribIndex,
363 vbuf, 366 vbuf,
364 GrGLAttribTypeToLayout(attribType).fCount, 367 GrGLAttribTypeToLayout(attribType).fCount,
365 GrGLAttribTypeToLayout(attribType).fType, 368 GrGLAttribTypeToLayout(attribType).fType,
366 GrGLAttribTypeToLayout(attribType).fNormalized, 369 GrGLAttribTypeToLayout(attribType).fNormalized,
367 stride, 370 stride,
368 reinterpret_cast<GrGLvoid*>( 371 reinterpret_cast<GrGLvoid*>(
369 vertexOffsetInBytes + vertexAttrib->fOffset)); 372 vertexOffsetInBytes + vertexAttrib->fOffset));
373 }
370 } 374 }
371 attribState->disableUnusedArrays(this, usedAttribArraysMask); 375 attribState->disableUnusedArrays(this, usedAttribArraysMask);
372 } 376 }
373 } 377 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698