| 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 #include "GrGLProgram.h" | 8 #include "GrGLProgram.h" |
| 9 | 9 |
| 10 #include "GrAllocator.h" | 10 #include "GrAllocator.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 fDesc = desc; | 45 fDesc = desc; |
| 46 fProgramID = 0; | 46 fProgramID = 0; |
| 47 | 47 |
| 48 fDstCopyTexUnit = -1; | 48 fDstCopyTexUnit = -1; |
| 49 | 49 |
| 50 fColor = GrColor_ILLEGAL; | 50 fColor = GrColor_ILLEGAL; |
| 51 fColorFilterColor = GrColor_ILLEGAL; | 51 fColorFilterColor = GrColor_ILLEGAL; |
| 52 | 52 |
| 53 if (fDesc.getHeader().fHasVertexCode || | 53 if (fDesc.getHeader().fHasVertexCode || |
| 54 !fGpu->glCaps().fixedFunctionSupport() || | 54 !fGpu->glCaps().fixedFunctionSupport() || |
| 55 !fGpu->glCaps().pathStencilingSupport()) { | 55 !fGpu->glCaps().pathRenderingSupport()) { |
| 56 | 56 |
| 57 GrGLFullShaderBuilder fullBuilder(fGpu, fUniformManager, fDesc); | 57 GrGLFullShaderBuilder fullBuilder(fGpu, fUniformManager, fDesc); |
| 58 if (this->genProgram(&fullBuilder, colorStages, coverageStages)) { | 58 if (this->genProgram(&fullBuilder, colorStages, coverageStages)) { |
| 59 fUniformHandles.fViewMatrixUni = fullBuilder.getViewMatrixUniform(); | 59 fUniformHandles.fViewMatrixUni = fullBuilder.getViewMatrixUniform(); |
| 60 fHasVertexShader = true; | 60 fHasVertexShader = true; |
| 61 } | 61 } |
| 62 } else { | 62 } else { |
| 63 GrGLFragmentOnlyShaderBuilder fragmentOnlyBuilder(fGpu, fUniformManager,
fDesc); | 63 GrGLFragmentOnlyShaderBuilder fragmentOnlyBuilder(fGpu, fUniformManager,
fDesc); |
| 64 if (this->genProgram(&fragmentOnlyBuilder, colorStages, coverageStages))
{ | 64 if (this->genProgram(&fragmentOnlyBuilder, colorStages, coverageStages))
{ |
| 65 fNumTexCoordSets = fragmentOnlyBuilder.getNumTexCoordSets(); | 65 fNumTexCoordSets = fragmentOnlyBuilder.getNumTexCoordSets(); |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 | 565 |
| 566 fMatrixState.fViewMatrix = drawState.getViewMatrix(); | 566 fMatrixState.fViewMatrix = drawState.getViewMatrix(); |
| 567 fMatrixState.fRenderTargetSize = size; | 567 fMatrixState.fRenderTargetSize = size; |
| 568 fMatrixState.fRenderTargetOrigin = rt->origin(); | 568 fMatrixState.fRenderTargetOrigin = rt->origin(); |
| 569 | 569 |
| 570 GrGLfloat viewMatrix[3 * 3]; | 570 GrGLfloat viewMatrix[3 * 3]; |
| 571 fMatrixState.getGLMatrix<3>(viewMatrix); | 571 fMatrixState.getGLMatrix<3>(viewMatrix); |
| 572 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); | 572 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); |
| 573 } | 573 } |
| 574 } | 574 } |
| OLD | NEW |