Index: gm/cubicpaths.cpp |
diff --git a/gm/cubicpaths.cpp b/gm/cubicpaths.cpp |
index ca6c057ec02f70761252655659d2232b098b7fb2..e0f6933f17603fb699c9de048568e969634a8ef3 100644 |
--- a/gm/cubicpaths.cpp |
+++ b/gm/cubicpaths.cpp |
@@ -60,15 +60,15 @@ public: |
protected: |
- SkString onShortName() { |
+ SkString onShortName() override { |
return SkString("clippedcubic2"); |
} |
- SkISize onISize() { return SkISize::Make(1240, 390); } |
+ SkISize onISize() override { return SkISize::Make(1240, 390); } |
void onDraw(SkCanvas* canvas) override { |
canvas->save(); |
- canvas->translate(-2, 20); |
+ canvas->translate(-2, 120); |
drawOne(canvas, fPath, SkRect::MakeLTRB(0, 0, 80, 150)); |
canvas->translate(0, 170); |
drawOne(canvas, fPath, SkRect::MakeLTRB(0, 0, 80, 100)); |
@@ -77,6 +77,16 @@ protected: |
canvas->translate(0, 170); |
drawOne(canvas, fPath, SkRect::MakeLTRB(0, 0, 10, 150)); |
canvas->restore(); |
+ canvas->save(); |
+ canvas->translate(20, -2); |
+ drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 150, 80)); |
+ canvas->translate(170, 0); |
+ drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 100, 80)); |
+ canvas->translate(170, 0); |
+ drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 150, 30)); |
+ canvas->translate(170, 0); |
+ drawOne(canvas, fFlipped, SkRect::MakeLTRB(0, 0, 150, 10)); |
+ canvas->restore(); |
} |
void drawOne(SkCanvas* canvas, const SkPath& path, const SkRect& clip) { |
@@ -97,9 +107,18 @@ protected: |
fPath.cubicTo( 11.608591683531916f, 87.33115f, -0.010765133872116195f, 109.16448333333332f, |
-0.013089005235602302f, 131); |
fPath.close(); |
+ fFlipped = fPath; |
+ SkMatrix matrix; |
+ matrix.reset(); |
+ matrix.setScaleX(0); |
+ matrix.setScaleY(0); |
+ matrix.setSkewX(1); |
+ matrix.setSkewY(1); |
+ fFlipped.transform(matrix); |
} |
SkPath fPath; |
+ SkPath fFlipped; |
private: |
typedef skiagm::GM INHERITED; |
}; |