| Index: gm/convex_all_line_paths.cpp
|
| diff --git a/gm/convex_all_line_paths.cpp b/gm/convex_all_line_paths.cpp
|
| index 0ffd65497cbf08ff910724f0917d0c09d50bd132..ba2d94b758c5c36277a0a0451ab21dff4f06ece3 100644
|
| --- a/gm/convex_all_line_paths.cpp
|
| +++ b/gm/convex_all_line_paths.cpp
|
| @@ -6,6 +6,7 @@
|
| */
|
|
|
| #include "gm.h"
|
| +#include "GrAAConvexTessellator.h"
|
|
|
| static void create_ngon(int n, SkPoint* pts, SkScalar width, SkScalar height) {
|
| float angleStep = 360.0f / n, angle = 0.0f, sin, cos;
|
| @@ -29,7 +30,7 @@ class ConvexLineOnlyPathsGM : public GM {
|
| public:
|
| ConvexLineOnlyPathsGM() {
|
| fOffset.set(0, SkScalarHalf(kMaxPathHeight));
|
| - this->setBGColor(0xFFFFFFFF);
|
| + this->setBGColor(0xFF404040);
|
| }
|
|
|
| protected:
|
| @@ -54,8 +55,8 @@ protected:
|
| };
|
| // trap - narrow on top - wide on bottom
|
| const SkPoint gPoints2[] = {
|
| - { -10.0f, -50.0f },
|
| - { 10.0f, -50.0f },
|
| + { -2.0f, -50.0f },
|
| + { 2.0f, -50.0f },
|
| { 50.0f, 50.0f },
|
| { -50.0f, 50.0f }
|
| };
|
| @@ -130,7 +131,7 @@ protected:
|
| { -65.45f, -29.39f },
|
| { -54.39f, -40.45f },
|
| { -40.45f, -47.55f },
|
| - { -25.0f, -50.0f },
|
| + { -25.0f, -50.0f },
|
| { -9.55f, -47.55f },
|
| { 4.39f, -40.45f },
|
| { 75.00f, 0.00f }
|
| @@ -283,6 +284,27 @@ protected:
|
| }
|
|
|
| void onDraw(SkCanvas* canvas) override {
|
| +#if 0
|
| + SkPath path = GetPath(8, 0, SkPath::kCCW_Direction);
|
| +
|
| + SkMatrix m2;
|
| + m2.setScale(0.01f, 0.01f);
|
| +// m2.postTranslate(kGMWidth/2, kGMHeight/2);
|
| +
|
| + path.transform(m2);
|
| +
|
| + GrAAConvexTessellator result;
|
| + result.setTargetDepth(40.0f);
|
| +
|
| + result.tessellate(SkMatrix::I(), path);
|
| +
|
| + canvas->translate(kGMWidth/2, kGMHeight/2);
|
| + canvas->scale(400, 400);
|
| +#if GR_AA_CONVEX_TESSELLATOR_VIZ
|
| + result.draw(canvas);
|
| +#endif
|
| +
|
| +#else
|
| for (int i = 0; i < kNumPaths; ++i) {
|
| this->drawPath(canvas, i);
|
| }
|
| @@ -301,13 +323,14 @@ protected:
|
| p1.lineTo(386.121399f, 689.940125f);
|
| canvas->drawPath(p1, p);
|
| }
|
| +#endif
|
| }
|
|
|
| private:
|
| static const int kNumPaths = 20;
|
| static const int kMaxPathHeight = 100;
|
| - static const int kGMWidth = 512;
|
| - static const int kGMHeight = 512;
|
| + static const int kGMWidth = 1024;
|
| + static const int kGMHeight = 1024;
|
|
|
| SkPoint fOffset; // the right edge of the last drawn path
|
|
|
|
|