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

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

Issue 1192463003: Don't call bindTexture from GrGLProgram (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | src/gpu/gl/GrGLProgram.h » ('j') | src/gpu/gl/GrGLProgram.cpp » ('J')
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 "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLStencilAttachment.h" 10 #include "GrGLStencilAttachment.h"
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 GrGLuint programID = program->programID(); 1468 GrGLuint programID = program->programID();
1469 if (fHWProgramID != programID) { 1469 if (fHWProgramID != programID) {
1470 GL_CALL(UseProgram(programID)); 1470 GL_CALL(UseProgram(programID));
1471 fHWProgramID = programID; 1471 fHWProgramID = programID;
1472 } 1472 }
1473 1473
1474 if (blendInfo.fWriteColor) { 1474 if (blendInfo.fWriteColor) {
1475 this->flushBlend(blendInfo); 1475 this->flushBlend(blendInfo);
1476 } 1476 }
1477 1477
1478 program->setData(*args.fPrimitiveProcessor, pipeline, *args.fBatchTracker); 1478 SkSTArray<8, const GrTextureAccess*> textureAccesses;
1479 program->setData(*args.fPrimitiveProcessor, pipeline, *args.fBatchTracker, & textureAccesses);
1480
1481 int numTextureAccesses = textureAccesses.count();
1482 for (int i = 0; i < numTextureAccesses; i++) {
1483 this->bindTexture(i, textureAccesses[i]->getParams(),
1484 static_cast<GrGLTexture*>(textureAccesses[i]->getTextu re()));
1485 }
1479 1486
1480 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa rget()); 1487 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa rget());
1481 this->flushStencil(pipeline.getStencil()); 1488 this->flushStencil(pipeline.getStencil());
1482 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or igin()); 1489 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or igin());
1483 this->flushHWAAState(glRT, pipeline.isHWAntialiasState()); 1490 this->flushHWAAState(glRT, pipeline.isHWAntialiasState());
1484 1491
1485 // This must come after textures are flushed because a texture may need 1492 // This must come after textures are flushed because a texture may need
1486 // to be msaa-resolved (which will modify bound FBO state). 1493 // to be msaa-resolved (which will modify bound FBO state).
1487 this->flushRenderTarget(glRT, NULL); 1494 this->flushRenderTarget(glRT, NULL);
1488 1495
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after
3079 this->setVertexArrayID(gpu, 0); 3086 this->setVertexArrayID(gpu, 0);
3080 } 3087 }
3081 int attrCount = gpu->glCaps().maxVertexAttributes(); 3088 int attrCount = gpu->glCaps().maxVertexAttributes();
3082 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3089 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3083 fDefaultVertexArrayAttribState.resize(attrCount); 3090 fDefaultVertexArrayAttribState.resize(attrCount);
3084 } 3091 }
3085 attribState = &fDefaultVertexArrayAttribState; 3092 attribState = &fDefaultVertexArrayAttribState;
3086 } 3093 }
3087 return attribState; 3094 return attribState;
3088 } 3095 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/GrGLProgram.h » ('j') | src/gpu/gl/GrGLProgram.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698