| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 bool coverageWillBeIgnored() const { return fCoverageWillBeIgnored; } | 54 bool coverageWillBeIgnored() const { return fCoverageWillBeIgnored; } |
| 55 bool hasVertexCoverage() const { return SkToBool(fInCoverage); } | 55 bool hasVertexCoverage() const { return SkToBool(fInCoverage); } |
| 56 | 56 |
| 57 class GLProcessor : public GrGLGeometryProcessor { | 57 class GLProcessor : public GrGLGeometryProcessor { |
| 58 public: | 58 public: |
| 59 GLProcessor() | 59 GLProcessor() |
| 60 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f
Coverage(0xff) {} | 60 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f
Coverage(0xff) {} |
| 61 | 61 |
| 62 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { | 62 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { |
| 63 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); | 63 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); |
| 64 GrGLGPBuilder* pb = args.fPB; | 64 GrGLSLGPBuilder* pb = args.fPB; |
| 65 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); | 65 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); |
| 66 GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder(); | 66 GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder(); |
| 67 | 67 |
| 68 // emit attributes | 68 // emit attributes |
| 69 vsBuilder->emitAttributes(gp); | 69 vsBuilder->emitAttributes(gp); |
| 70 | 70 |
| 71 // Setup pass through color | 71 // Setup pass through color |
| 72 if (!gp.colorIgnored()) { | 72 if (!gp.colorIgnored()) { |
| 73 if (gp.hasVertexColor()) { | 73 if (gp.hasVertexColor()) { |
| 74 pb->addPassThroughAttribute(gp.inColor(), args.fOutputColor)
; | 74 pb->addPassThroughAttribute(gp.inColor(), args.fOutputColor)
; |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 310 } |
| 311 | 311 |
| 312 if (localCoords.hasLocalMatrix()) { | 312 if (localCoords.hasLocalMatrix()) { |
| 313 invert.preConcat(*localCoords.fMatrix); | 313 invert.preConcat(*localCoords.fMatrix); |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 | 316 |
| 317 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); | 317 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); |
| 318 return Create(color, coverage, inverted, SkMatrix::I()); | 318 return Create(color, coverage, inverted, SkMatrix::I()); |
| 319 } | 319 } |
| OLD | NEW |