| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrPLSPathRenderer.h" | 8 #include "GrPLSPathRenderer.h" |
| 9 | 9 |
| 10 #include "SkChunkAlloc.h" | 10 #include "SkChunkAlloc.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 } | 392 } |
| 393 | 393 |
| 394 virtual void setData(const GrGLSLProgramDataManager& pdman, | 394 virtual void setData(const GrGLSLProgramDataManager& pdman, |
| 395 const GrPrimitiveProcessor& gp) override { | 395 const GrPrimitiveProcessor& gp) override { |
| 396 } | 396 } |
| 397 | 397 |
| 398 void setTransformData(const GrPrimitiveProcessor& primProc, | 398 void setTransformData(const GrPrimitiveProcessor& primProc, |
| 399 const GrGLSLProgramDataManager& pdman, | 399 const GrGLSLProgramDataManager& pdman, |
| 400 int index, | 400 int index, |
| 401 const SkTArray<const GrCoordTransform*, true>& tra
nsforms) override { | 401 const SkTArray<const GrCoordTransform*, true>& tra
nsforms) override { |
| 402 this->setTransformDataHelper<PLSAATriangleEffect>(primProc, pdman, i
ndex, transforms); | 402 this->setTransformDataHelper(primProc.cast<PLSAATriangleEffect>().fL
ocalMatrix, pdman, |
| 403 index, transforms); |
| 403 } | 404 } |
| 404 | 405 |
| 405 private: | 406 private: |
| 406 typedef GrGLSLGeometryProcessor INHERITED; | 407 typedef GrGLSLGeometryProcessor INHERITED; |
| 407 }; | 408 }; |
| 408 | 409 |
| 409 virtual void getGLSLProcessorKey(const GrGLSLCaps& caps, | 410 virtual void getGLSLProcessorKey(const GrGLSLCaps& caps, |
| 410 GrProcessorKeyBuilder* b) const override { | 411 GrProcessorKeyBuilder* b) const override { |
| 411 GLSLProcessor::GenKey(*this, caps, b); | 412 GLSLProcessor::GenKey(*this, caps, b); |
| 412 } | 413 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 } | 582 } |
| 582 | 583 |
| 583 virtual void setData(const GrGLSLProgramDataManager& pdman, | 584 virtual void setData(const GrGLSLProgramDataManager& pdman, |
| 584 const GrPrimitiveProcessor& gp) override { | 585 const GrPrimitiveProcessor& gp) override { |
| 585 } | 586 } |
| 586 | 587 |
| 587 void setTransformData(const GrPrimitiveProcessor& primProc, | 588 void setTransformData(const GrPrimitiveProcessor& primProc, |
| 588 const GrGLSLProgramDataManager& pdman, | 589 const GrGLSLProgramDataManager& pdman, |
| 589 int index, | 590 int index, |
| 590 const SkTArray<const GrCoordTransform*, true>& tra
nsforms) override { | 591 const SkTArray<const GrCoordTransform*, true>& tra
nsforms) override { |
| 591 this->setTransformDataHelper<PLSQuadEdgeEffect>(primProc, pdman, ind
ex, transforms); | 592 this->setTransformDataHelper(primProc.cast<PLSQuadEdgeEffect>().fLoc
alMatrix, pdman, |
| 593 index, transforms); |
| 592 } | 594 } |
| 593 | 595 |
| 594 private: | 596 private: |
| 595 typedef GrGLSLGeometryProcessor INHERITED; | 597 typedef GrGLSLGeometryProcessor INHERITED; |
| 596 }; | 598 }; |
| 597 | 599 |
| 598 virtual void getGLSLProcessorKey(const GrGLSLCaps& caps, | 600 virtual void getGLSLProcessorKey(const GrGLSLCaps& caps, |
| 599 GrProcessorKeyBuilder* b) const override { | 601 GrProcessorKeyBuilder* b) const override { |
| 600 GLSLProcessor::GenKey(*this, caps, b); | 602 GLSLProcessor::GenKey(*this, caps, b); |
| 601 } | 603 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 GrColorToRGBAFloat(fe.color(), c); | 726 GrColorToRGBAFloat(fe.color(), c); |
| 725 pdman.set4fv(fColorUniform, 1, c); | 727 pdman.set4fv(fColorUniform, 1, c); |
| 726 fColor = fe.color(); | 728 fColor = fe.color(); |
| 727 } | 729 } |
| 728 } | 730 } |
| 729 | 731 |
| 730 void setTransformData(const GrPrimitiveProcessor& primProc, | 732 void setTransformData(const GrPrimitiveProcessor& primProc, |
| 731 const GrGLSLProgramDataManager& pdman, | 733 const GrGLSLProgramDataManager& pdman, |
| 732 int index, | 734 int index, |
| 733 const SkTArray<const GrCoordTransform*, true>& tra
nsforms) override { | 735 const SkTArray<const GrCoordTransform*, true>& tra
nsforms) override { |
| 734 this->setTransformDataHelper<PLSFinishEffect>(primProc, pdman, index
, transforms); | 736 this->setTransformDataHelper(primProc.cast<PLSFinishEffect>().fLocal
Matrix, pdman, |
| 737 index, transforms); |
| 735 } | 738 } |
| 736 | 739 |
| 737 private: | 740 private: |
| 738 GrColor fColor; | 741 GrColor fColor; |
| 739 UniformHandle fColorUniform; | 742 UniformHandle fColorUniform; |
| 740 UniformHandle fUseEvenOdd; | 743 UniformHandle fUseEvenOdd; |
| 741 | 744 |
| 742 typedef GrGLSLGeometryProcessor INHERITED; | 745 typedef GrGLSLGeometryProcessor INHERITED; |
| 743 }; | 746 }; |
| 744 | 747 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 | 970 |
| 968 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { | 971 DRAW_BATCH_TEST_DEFINE(PLSPathBatch) { |
| 969 GrColor color = GrRandomColor(random); | 972 GrColor color = GrRandomColor(random); |
| 970 SkMatrix vm = GrTest::TestMatrixInvertible(random); | 973 SkMatrix vm = GrTest::TestMatrixInvertible(random); |
| 971 SkPath path = GrTest::TestPathConvex(random); | 974 SkPath path = GrTest::TestPathConvex(random); |
| 972 | 975 |
| 973 return new PLSPathBatch(color, path, vm); | 976 return new PLSPathBatch(color, path, vm); |
| 974 } | 977 } |
| 975 | 978 |
| 976 #endif | 979 #endif |
| OLD | NEW |