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 "GrDefaultGeoProcFactory.h" | 8 #include "GrDefaultGeoProcFactory.h" |
9 | 9 |
10 #include "GrInvariantOutput.h" | 10 #include "GrInvariantOutput.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 class GLProcessor : public GrGLGeometryProcessor { | 80 class GLProcessor : public GrGLGeometryProcessor { |
81 public: | 81 public: |
82 GLProcessor(const GrGeometryProcessor& gp, const GrBatchTracker&) | 82 GLProcessor(const GrGeometryProcessor& gp, const GrBatchTracker&) |
83 : fColor(GrColor_ILLEGAL), fCoverage(0xff) {} | 83 : fColor(GrColor_ILLEGAL), fCoverage(0xff) {} |
84 | 84 |
85 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { | 85 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { |
86 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); | 86 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); |
87 GrGLGPBuilder* pb = args.fPB; | 87 GrGLGPBuilder* pb = args.fPB; |
88 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); | 88 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); |
89 GrGLGPFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder(); | 89 GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder(); |
90 const BatchTracker& local = args.fBT.cast<BatchTracker>(); | 90 const BatchTracker& local = args.fBT.cast<BatchTracker>(); |
91 | 91 |
92 // emit attributes | 92 // emit attributes |
93 vsBuilder->emitAttributes(gp); | 93 vsBuilder->emitAttributes(gp); |
94 | 94 |
95 // Setup pass through color | 95 // Setup pass through color |
96 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputC
olor, gp.inColor(), | 96 this->setupColorPassThrough(pb, local.fInputColorType, args.fOutputC
olor, gp.inColor(), |
97 &fColorUniform); | 97 &fColorUniform); |
98 // Setup position | 98 // Setup position |
99 this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatri
x()); | 99 this->setupPosition(pb, gpArgs, gp.inPosition()->fName, gp.viewMatri
x()); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 const SkMatrix& local
Matrix, | 277 const SkMatrix& local
Matrix, |
278 bool opaqueVertexColo
rs, | 278 bool opaqueVertexColo
rs, |
279 uint8_t coverage) { | 279 uint8_t coverage) { |
280 return DefaultGeoProc::Create(gpTypeFlags, | 280 return DefaultGeoProc::Create(gpTypeFlags, |
281 color, | 281 color, |
282 viewMatrix, | 282 viewMatrix, |
283 localMatrix, | 283 localMatrix, |
284 opaqueVertexColors, | 284 opaqueVertexColors, |
285 coverage); | 285 coverage); |
286 } | 286 } |
OLD | NEW |