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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 , fNumTexCoordSets(0) { | 44 , fNumTexCoordSets(0) { |
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->shouldUseFixedFunctionTexturing()) { |
55 !fGpu->glCaps().pathRenderingSupport()) { | |
56 | |
57 GrGLFullShaderBuilder fullBuilder(fGpu, fUniformManager, fDesc); | 55 GrGLFullShaderBuilder fullBuilder(fGpu, fUniformManager, fDesc); |
58 if (this->genProgram(&fullBuilder, colorStages, coverageStages)) { | 56 if (this->genProgram(&fullBuilder, colorStages, coverageStages)) { |
59 fUniformHandles.fViewMatrixUni = fullBuilder.getViewMatrixUniform(); | 57 fUniformHandles.fViewMatrixUni = fullBuilder.getViewMatrixUniform(); |
60 fHasVertexShader = true; | 58 fHasVertexShader = true; |
61 } | 59 } |
62 } else { | 60 } else { |
63 GrGLFragmentOnlyShaderBuilder fragmentOnlyBuilder(fGpu, fUniformManager,
fDesc); | 61 GrGLFragmentOnlyShaderBuilder fragmentOnlyBuilder(fGpu, fUniformManager,
fDesc); |
64 if (this->genProgram(&fragmentOnlyBuilder, colorStages, coverageStages))
{ | 62 if (this->genProgram(&fragmentOnlyBuilder, colorStages, coverageStages))
{ |
65 fNumTexCoordSets = fragmentOnlyBuilder.getNumTexCoordSets(); | 63 fNumTexCoordSets = fragmentOnlyBuilder.getNumTexCoordSets(); |
66 } | 64 } |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 | 490 |
493 fMatrixState.fViewMatrix = drawState.getViewMatrix(); | 491 fMatrixState.fViewMatrix = drawState.getViewMatrix(); |
494 fMatrixState.fRenderTargetSize = size; | 492 fMatrixState.fRenderTargetSize = size; |
495 fMatrixState.fRenderTargetOrigin = rt->origin(); | 493 fMatrixState.fRenderTargetOrigin = rt->origin(); |
496 | 494 |
497 GrGLfloat viewMatrix[3 * 3]; | 495 GrGLfloat viewMatrix[3 * 3]; |
498 fMatrixState.getGLMatrix<3>(viewMatrix); | 496 fMatrixState.getGLMatrix<3>(viewMatrix); |
499 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); | 497 fUniformManager.setMatrix3f(fUniformHandles.fViewMatrixUni, viewMatrix); |
500 } | 498 } |
501 } | 499 } |
OLD | NEW |