| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrGLFragmentOnlyProgramBuilder.h" | 8 #include "GrGLFragmentOnlyProgramBuilder.h" |
| 9 #include "../GrGpuGL.h" | 9 #include "../GrGpuGL.h" |
| 10 | 10 |
| 11 GrGLFragmentOnlyProgramBuilder::GrGLFragmentOnlyProgramBuilder(GrGpuGL* gpu, | 11 GrGLFragmentOnlyProgramBuilder::GrGLFragmentOnlyProgramBuilder(GrGpuGL* gpu, |
| 12 const GrOptDrawSt
ate& optState, |
| 12 const GrGLProgram
Desc& desc) | 13 const GrGLProgram
Desc& desc) |
| 13 : INHERITED(gpu, desc) { | 14 : INHERITED(gpu, optState, desc) { |
| 14 SkASSERT(desc.getHeader().fUseFragShaderOnly); | 15 SkASSERT(desc.getHeader().fUseFragShaderOnly); |
| 15 SkASSERT(gpu->glCaps().pathRenderingSupport()); | 16 SkASSERT(gpu->glCaps().pathRenderingSupport()); |
| 16 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn
put); | 17 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fColorIn
put); |
| 17 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag
eInput); | 18 SkASSERT(GrGLProgramDesc::kAttribute_ColorInput != desc.getHeader().fCoverag
eInput); |
| 18 } | 19 } |
| 19 | 20 |
| 20 int GrGLFragmentOnlyProgramBuilder::addTexCoordSets(int count) { | 21 int GrGLFragmentOnlyProgramBuilder::addTexCoordSets(int count) { |
| 21 int firstFreeCoordSet = fTexCoordSetCnt; | 22 int firstFreeCoordSet = fTexCoordSetCnt; |
| 22 fTexCoordSetCnt += count; | 23 fTexCoordSetCnt += count; |
| 23 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; | 24 SkASSERT(gpu()->glCaps().maxFixedFunctionTextureCoords() >= fTexCoordSetCnt)
; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 for (int t = 0; t < numTransforms; ++t) { | 98 for (int t = 0; t < numTransforms; ++t) { |
| 98 GrSLType type = | 99 GrSLType type = |
| 99 effectStage.isPerspectiveCoordTransform(t, false) ? | 100 effectStage.isPerspectiveCoordTransform(t, false) ? |
| 100 kVec3f_GrSLType : | 101 kVec3f_GrSLType : |
| 101 kVec2f_GrSLType; | 102 kVec2f_GrSLType; |
| 102 | 103 |
| 103 name.printf("%s(gl_TexCoord[%i])", GrGLSLTypeString(type), texCoordIndex
++); | 104 name.printf("%s(gl_TexCoord[%i])", GrGLSLTypeString(type), texCoordIndex
++); |
| 104 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, (nam
e, type)); | 105 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, (nam
e, type)); |
| 105 } | 106 } |
| 106 } | 107 } |
| OLD | NEW |