OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrAAConvexPathRenderer.h" | 8 #include "GrAAConvexPathRenderer.h" |
9 | 9 |
10 #include "GrAAConvexTessellator.h" | 10 #include "GrAAConvexTessellator.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 return sk_sp<GrGeometryProcessor>(new QuadEdgeEffect(color, localMatrix, usesLocalCoords)); | 531 return sk_sp<GrGeometryProcessor>(new QuadEdgeEffect(color, localMatrix, usesLocalCoords)); |
532 } | 532 } |
533 | 533 |
534 virtual ~QuadEdgeEffect() {} | 534 virtual ~QuadEdgeEffect() {} |
535 | 535 |
536 const char* name() const override { return "QuadEdge"; } | 536 const char* name() const override { return "QuadEdge"; } |
537 | 537 |
538 const Attribute* inPosition() const { return fInPosition; } | 538 const Attribute* inPosition() const { return fInPosition; } |
539 const Attribute* inQuadEdge() const { return fInQuadEdge; } | 539 const Attribute* inQuadEdge() const { return fInQuadEdge; } |
540 GrColor color() const { return fColor; } | 540 GrColor color() const { return fColor; } |
541 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } | 541 bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } |
robertphillips
2016/08/17 16:27:25
??
bsalomon
2016/08/17 16:33:00
same, still used in emitCode()
| |
542 const SkMatrix& localMatrix() const { return fLocalMatrix; } | 542 const SkMatrix& localMatrix() const { return fLocalMatrix; } |
543 bool usesLocalCoords() const { return fUsesLocalCoords; } | 543 bool usesLocalCoords() const { return fUsesLocalCoords; } |
544 | 544 |
545 class GLSLProcessor : public GrGLSLGeometryProcessor { | 545 class GLSLProcessor : public GrGLSLGeometryProcessor { |
546 public: | 546 public: |
547 GLSLProcessor() | 547 GLSLProcessor() |
548 : fColor(GrColor_ILLEGAL) {} | 548 : fColor(GrColor_ILLEGAL) {} |
549 | 549 |
550 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { | 550 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { |
551 const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>(); | 551 const QuadEdgeEffect& qe = args.fGP.cast<QuadEdgeEffect>(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
621 GrColorToRGBAFloat(qe.color(), c); | 621 GrColorToRGBAFloat(qe.color(), c); |
622 pdman.set4fv(fColorUniform, 1, c); | 622 pdman.set4fv(fColorUniform, 1, c); |
623 fColor = qe.color(); | 623 fColor = qe.color(); |
624 } | 624 } |
625 } | 625 } |
626 | 626 |
627 void setTransformData(const GrPrimitiveProcessor& primProc, | 627 void setTransformData(const GrPrimitiveProcessor& primProc, |
628 const GrGLSLProgramDataManager& pdman, | 628 const GrGLSLProgramDataManager& pdman, |
629 int index, | 629 int index, |
630 const SkTArray<const GrCoordTransform*, true>& tra nsforms) override { | 630 const SkTArray<const GrCoordTransform*, true>& tra nsforms) override { |
631 this->setTransformDataHelper<QuadEdgeEffect>(primProc, pdman, index, transforms); | 631 this->setTransformDataHelper(primProc.cast<QuadEdgeEffect>().fLocalM atrix, pdman, index, |
632 transforms); | |
632 } | 633 } |
633 | 634 |
634 private: | 635 private: |
635 GrColor fColor; | 636 GrColor fColor; |
636 UniformHandle fColorUniform; | 637 UniformHandle fColorUniform; |
637 | 638 |
638 typedef GrGLSLGeometryProcessor INHERITED; | 639 typedef GrGLSLGeometryProcessor INHERITED; |
639 }; | 640 }; |
640 | 641 |
641 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c onst override { | 642 void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) c onst override { |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1016 | 1017 |
1017 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { | 1018 DRAW_BATCH_TEST_DEFINE(AAConvexPathBatch) { |
1018 GrColor color = GrRandomColor(random); | 1019 GrColor color = GrRandomColor(random); |
1019 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); | 1020 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); |
1020 SkPath path = GrTest::TestPathConvex(random); | 1021 SkPath path = GrTest::TestPathConvex(random); |
1021 | 1022 |
1022 return new AAConvexPathBatch(color, viewMatrix, path); | 1023 return new AAConvexPathBatch(color, viewMatrix, path); |
1023 } | 1024 } |
1024 | 1025 |
1025 #endif | 1026 #endif |
OLD | NEW |