| 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 "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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |