| 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 "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
| (...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 if (fHWProgramID != programID) { | 1563 if (fHWProgramID != programID) { |
| 1564 GL_CALL(UseProgram(programID)); | 1564 GL_CALL(UseProgram(programID)); |
| 1565 fHWProgramID = programID; | 1565 fHWProgramID = programID; |
| 1566 } | 1566 } |
| 1567 | 1567 |
| 1568 if (blendInfo.fWriteColor) { | 1568 if (blendInfo.fWriteColor) { |
| 1569 this->flushBlend(blendInfo); | 1569 this->flushBlend(blendInfo); |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 SkSTArray<8, const GrTextureAccess*> textureAccesses; | 1572 SkSTArray<8, const GrTextureAccess*> textureAccesses; |
| 1573 program->setData(*args.fPrimitiveProcessor, pipeline, *args.fBatchTracker, &
textureAccesses); | 1573 program->setData(*args.fPrimitiveProcessor, pipeline, &textureAccesses); |
| 1574 | 1574 |
| 1575 int numTextureAccesses = textureAccesses.count(); | 1575 int numTextureAccesses = textureAccesses.count(); |
| 1576 for (int i = 0; i < numTextureAccesses; i++) { | 1576 for (int i = 0; i < numTextureAccesses; i++) { |
| 1577 this->bindTexture(i, textureAccesses[i]->getParams(), | 1577 this->bindTexture(i, textureAccesses[i]->getParams(), |
| 1578 static_cast<GrGLTexture*>(textureAccesses[i]->getTextu
re())); | 1578 static_cast<GrGLTexture*>(textureAccesses[i]->getTextu
re())); |
| 1579 } | 1579 } |
| 1580 | 1580 |
| 1581 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa
rget()); | 1581 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTa
rget()); |
| 1582 this->flushStencil(pipeline.getStencil()); | 1582 this->flushStencil(pipeline.getStencil()); |
| 1583 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or
igin()); | 1583 this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->or
igin()); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1638 stride, | 1638 stride, |
| 1639 reinterpret_cast<GrGLvoid*>(vertexOffsetInBytes + o
ffset)); | 1639 reinterpret_cast<GrGLvoid*>(vertexOffsetInBytes + o
ffset)); |
| 1640 offset += attrib.fOffset; | 1640 offset += attrib.fOffset; |
| 1641 } | 1641 } |
| 1642 attribState->disableUnusedArrays(this, usedAttribArraysMask); | 1642 attribState->disableUnusedArrays(this, usedAttribArraysMask); |
| 1643 } | 1643 } |
| 1644 } | 1644 } |
| 1645 | 1645 |
| 1646 void GrGLGpu::buildProgramDesc(GrProgramDesc* desc, | 1646 void GrGLGpu::buildProgramDesc(GrProgramDesc* desc, |
| 1647 const GrPrimitiveProcessor& primProc, | 1647 const GrPrimitiveProcessor& primProc, |
| 1648 const GrPipeline& pipeline, | 1648 const GrPipeline& pipeline) const { |
| 1649 const GrBatchTracker& batchTracker) const { | 1649 if (!GrGLProgramDescBuilder::Build(desc, primProc, pipeline, this)) { |
| 1650 if (!GrGLProgramDescBuilder::Build(desc, primProc, pipeline, this, batchTrac
ker)) { | |
| 1651 SkDEBUGFAIL("Failed to generate GL program descriptor"); | 1650 SkDEBUGFAIL("Failed to generate GL program descriptor"); |
| 1652 } | 1651 } |
| 1653 } | 1652 } |
| 1654 | 1653 |
| 1655 void GrGLGpu::disableScissor() { | 1654 void GrGLGpu::disableScissor() { |
| 1656 if (kNo_TriState != fHWScissorSettings.fEnabled) { | 1655 if (kNo_TriState != fHWScissorSettings.fEnabled) { |
| 1657 GL_CALL(Disable(GR_GL_SCISSOR_TEST)); | 1656 GL_CALL(Disable(GR_GL_SCISSOR_TEST)); |
| 1658 fHWScissorSettings.fEnabled = kNo_TriState; | 1657 fHWScissorSettings.fEnabled = kNo_TriState; |
| 1659 return; | 1658 return; |
| 1660 } | 1659 } |
| (...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3265 this->setVertexArrayID(gpu, 0); | 3264 this->setVertexArrayID(gpu, 0); |
| 3266 } | 3265 } |
| 3267 int attrCount = gpu->glCaps().maxVertexAttributes(); | 3266 int attrCount = gpu->glCaps().maxVertexAttributes(); |
| 3268 if (fDefaultVertexArrayAttribState.count() != attrCount) { | 3267 if (fDefaultVertexArrayAttribState.count() != attrCount) { |
| 3269 fDefaultVertexArrayAttribState.resize(attrCount); | 3268 fDefaultVertexArrayAttribState.resize(attrCount); |
| 3270 } | 3269 } |
| 3271 attribState = &fDefaultVertexArrayAttribState; | 3270 attribState = &fDefaultVertexArrayAttribState; |
| 3272 } | 3271 } |
| 3273 return attribState; | 3272 return attribState; |
| 3274 } | 3273 } |
| OLD | NEW |