| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 bool hasVertexCoverage() const { return SkToBool(fInCoverage); } | 58 bool hasVertexCoverage() const { return SkToBool(fInCoverage); } |
| 59 | 59 |
| 60 class GLSLProcessor : public GrGLSLGeometryProcessor { | 60 class GLSLProcessor : public GrGLSLGeometryProcessor { |
| 61 public: | 61 public: |
| 62 GLSLProcessor() | 62 GLSLProcessor() |
| 63 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f
Coverage(0xff) {} | 63 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f
Coverage(0xff) {} |
| 64 | 64 |
| 65 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { | 65 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { |
| 66 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); | 66 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); |
| 67 GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder; | 67 GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder; |
| 68 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; | 68 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder; |
| 69 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; | 69 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; |
| 70 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; | 70 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
| 71 | 71 |
| 72 // emit attributes | 72 // emit attributes |
| 73 varyingHandler->emitAttributes(gp); | 73 varyingHandler->emitAttributes(gp); |
| 74 | 74 |
| 75 // Setup pass through color | 75 // Setup pass through color |
| 76 if (!gp.colorIgnored()) { | 76 if (!gp.colorIgnored()) { |
| 77 if (gp.hasVertexColor()) { | 77 if (gp.hasVertexColor()) { |
| 78 varyingHandler->addPassThroughAttribute(gp.inColor(), args.f
OutputColor); | 78 varyingHandler->addPassThroughAttribute(gp.inColor(), args.f
OutputColor); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 } | 334 } |
| 335 | 335 |
| 336 if (localCoords.hasLocalMatrix()) { | 336 if (localCoords.hasLocalMatrix()) { |
| 337 invert.preConcat(*localCoords.fMatrix); | 337 invert.preConcat(*localCoords.fMatrix); |
| 338 } | 338 } |
| 339 } | 339 } |
| 340 | 340 |
| 341 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); | 341 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); |
| 342 return Create(color, coverage, inverted, SkMatrix::I()); | 342 return Create(color, coverage, inverted, SkMatrix::I()); |
| 343 } | 343 } |
| OLD | NEW |