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

Unified Diff: samplecode/SampleConcavePaths.cpp

Issue 692583002: WIP: GPU-accelerated trapezoidal path renderer. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename GrTrapezoidalPathRenderer -> GrAAConcavePathRenderer; swap MSAA support for a coverage ramp. 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 | « samplecode/SampleApp.cpp ('k') | src/core/SkEdge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleConcavePaths.cpp
diff --git a/samplecode/SampleConcavePaths.cpp b/samplecode/SampleConcavePaths.cpp
index fb5447efc76673c3af946af4eeedcf4013262f5b..de8389ab780b350989ce1f3ee4b3681e7a2839fc 100644
--- a/samplecode/SampleConcavePaths.cpp
+++ b/samplecode/SampleConcavePaths.cpp
@@ -135,6 +135,50 @@ protected:
canvas->drawPath(path, paint);
canvas->restore();
}
+ if (1) {
+ SkPath path;
+ canvas->save();
+ canvas->translate(300, 100);
+ path.moveTo(30, 20);
+ path.lineTo(50, 80);
+ path.lineTo(70, 20);
+ path.lineTo(20, 57);
+ path.lineTo(80, 57);
+ path.close();
+ canvas->drawPath(path, paint);
+ canvas->restore();
+ }
+ // Quadratic path test.
+ if (1) {
+ SkPath path;
+ canvas->save();
+ canvas->translate(0, 200);
+ path.moveTo(SkIntToScalar(20), SkIntToScalar(50));
+ path.quadTo(SkIntToScalar(50), SkIntToScalar(50), SkIntToScalar(50), SkIntToScalar(20));
+ path.lineTo(SkIntToScalar(80), SkIntToScalar(20));
+ path.lineTo(SkIntToScalar(80), SkIntToScalar(80));
+ path.lineTo(SkIntToScalar(20), SkIntToScalar(80));
+ canvas->drawPath(path, paint);
+ canvas->restore();
+ }
+ // Cubic path test.
+ if (1) {
+ SkPath path;
+ canvas->save();
+ canvas->translate(100, 200);
+ path.moveTo(SkIntToScalar(20), SkIntToScalar(50));
+// path.cubicTo(SkIntToScalar(20), SkIntToScalar(20),
+// SkIntToScalar(70), SkIntToScalar(70),
+// SkIntToScalar(50), SkIntToScalar(20));
+ path.cubicTo(SkIntToScalar(60), SkIntToScalar(40),
+ SkIntToScalar(-20), SkIntToScalar(30),
+ SkIntToScalar(50), SkIntToScalar(20));
+ path.lineTo(SkIntToScalar(80), SkIntToScalar(20));
+ path.lineTo(SkIntToScalar(80), SkIntToScalar(80));
+ path.lineTo(SkIntToScalar(20), SkIntToScalar(80));
+ canvas->drawPath(path, paint);
+ canvas->restore();
+ }
}
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y,
« no previous file with comments | « samplecode/SampleApp.cpp ('k') | src/core/SkEdge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698