Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: gm/cubicpaths.cpp

Issue 1303873003: fix cubic clip in y (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix override Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkEdgeClipper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « no previous file | src/core/SkEdgeClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698