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 "gl/GrGLProgram.h" | 8 #include "gl/GrGLProgram.h" |
9 #include "gl/GrGLSLPrettyPrint.h" | 9 #include "gl/GrGLSLPrettyPrint.h" |
10 #include "gl/GrGLUniformHandle.h" | 10 #include "gl/GrGLUniformHandle.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return false; | 77 return false; |
78 } | 78 } |
79 | 79 |
80 return true; | 80 return true; |
81 } | 81 } |
82 | 82 |
83 ////////////////////////////////////////////////////////////////////////////// | 83 ////////////////////////////////////////////////////////////////////////////// |
84 | 84 |
85 GrGLProgramBuilder::GrGLProgramBuilder(GrGpuGL* gpu, | 85 GrGLProgramBuilder::GrGLProgramBuilder(GrGpuGL* gpu, |
86 const GrGLProgramDesc& desc) | 86 const GrGLProgramDesc& desc) |
87 : fFragOnly(!desc.getHeader().fRequiresVertexShader && | 87 : fFragOnly(SkToBool(desc.getHeader().fUseFragShaderOnly)) |
88 gpu->glCaps().pathRenderingSupport() && | |
89 gpu->glPathRendering()->texturingMode() == GrGLPathRendering::Fi
xedFunction_TexturingMode) | |
90 , fTexCoordSetCnt(0) | 88 , fTexCoordSetCnt(0) |
91 , fProgramID(0) | 89 , fProgramID(0) |
92 , fFS(this, desc) | 90 , fFS(this, desc) |
93 , fSeparableVaryingInfos(kVarsPerBlock) | 91 , fSeparableVaryingInfos(kVarsPerBlock) |
94 , fDesc(desc) | 92 , fDesc(desc) |
95 , fGpu(gpu) | 93 , fGpu(gpu) |
96 , fUniforms(kVarsPerBlock) { | 94 , fUniforms(kVarsPerBlock) { |
97 } | 95 } |
98 | 96 |
99 void GrGLProgramBuilder::nameVariable(SkString* out, char prefix, const char* na
me) { | 97 void GrGLProgramBuilder::nameVariable(SkString* out, char prefix, const char* na
me) { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 GetProgramResourceLocation(programId, | 317 GetProgramResourceLocation(programId, |
320 GR_GL_FRAGMENT_INPUT, | 318 GR_GL_FRAGMENT_INPUT, |
321 fSeparableVaryingInfos[i].fVariab
le.c_str())); | 319 fSeparableVaryingInfos[i].fVariab
le.c_str())); |
322 fSeparableVaryingInfos[i].fLocation = location; | 320 fSeparableVaryingInfos[i].fLocation = location; |
323 } | 321 } |
324 } | 322 } |
325 | 323 |
326 const GrGLContextInfo& GrGLProgramBuilder::ctxInfo() const { | 324 const GrGLContextInfo& GrGLProgramBuilder::ctxInfo() const { |
327 return fGpu->ctxInfo(); | 325 return fGpu->ctxInfo(); |
328 } | 326 } |
OLD | NEW |