OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrGLPathProcessor.h" | 8 #include "GrGLPathProcessor.h" |
9 | 9 |
10 #include "GrPathProcessor.h" | 10 #include "GrPathProcessor.h" |
11 #include "GrGLGpu.h" | 11 #include "GrGLGpu.h" |
12 #include "GrGLPathRendering.h" | 12 #include "GrGLPathRendering.h" |
13 | 13 |
14 GrGLPathProcessor::GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracke
r&) | 14 GrGLPathProcessor::GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracke
r&) |
15 : fColor(GrColor_ILLEGAL) {} | 15 : fColor(GrColor_ILLEGAL) {} |
16 | 16 |
17 void GrGLPathProcessor::emitCode(EmitArgs& args) { | 17 void GrGLPathProcessor::emitCode(EmitArgs& args) { |
18 GrGLGPBuilder* pb = args.fPB; | 18 GrGLGPBuilder* pb = args.fPB; |
19 GrGLGPFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder(); | 19 GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder(); |
20 const PathBatchTracker& local = args.fBT.cast<PathBatchTracker>(); | 20 const PathBatchTracker& local = args.fBT.cast<PathBatchTracker>(); |
21 | 21 |
22 // emit transforms | 22 // emit transforms |
23 this->emitTransforms(args.fPB, args.fTransformsIn, args.fTransformsOut); | 23 this->emitTransforms(args.fPB, args.fTransformsIn, args.fTransformsOut); |
24 | 24 |
25 // Setup uniform color | 25 // Setup uniform color |
26 if (kUniform_GrGPInput == local.fInputColorType) { | 26 if (kUniform_GrGPInput == local.fInputColorType) { |
27 const char* stagedLocalVarName; | 27 const char* stagedLocalVarName; |
28 fColorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility, | 28 fColorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility, |
29 kVec4f_GrSLType, | 29 kVec4f_GrSLType, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 SkASSERT(transforms[t].fType == kVec2f_GrSLType || | 123 SkASSERT(transforms[t].fType == kVec2f_GrSLType || |
124 transforms[t].fType == kVec3f_GrSLType); | 124 transforms[t].fType == kVec3f_GrSLType); |
125 unsigned components = transforms[t].fType == kVec2f_GrSLType ? 2 : 3; | 125 unsigned components = transforms[t].fType == kVec2f_GrSLType ? 2 : 3; |
126 glpr->setProgramPathFragmentInputTransform(programID, | 126 glpr->setProgramPathFragmentInputTransform(programID, |
127 fragmentInput.fLocation, | 127 fragmentInput.fLocation, |
128 GR_GL_OBJECT_LINEAR, | 128 GR_GL_OBJECT_LINEAR, |
129 components, | 129 components, |
130 transform); | 130 transform); |
131 } | 131 } |
132 } | 132 } |
OLD | NEW |