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

Unified Diff: gm/aaa.cpp

Issue 2386293002: Add GMs for Analytic Anti-Aliasing (Closed)
Patch Set: SkScalar Created 4 years, 2 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 | gm/addarc.cpp » ('j') | gm/addarc.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/aaa.cpp
diff --git a/gm/aaa.cpp b/gm/aaa.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d49d3f06c38a9019d7fbf140777cf3fc510b8be2
--- /dev/null
+++ b/gm/aaa.cpp
@@ -0,0 +1,59 @@
+/*
robertphillips 2016/10/07 14:12:46 2014 ?
liyuqian 2016/10/07 14:15:50 Ah, sorry that I forget to change this to 2016...
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gm.h"
+#include "SkPath.h"
+#include "SkScan.h"
+
+#define W 800
+#define H 800
+
+class AnalyticAntiAliasConvexGM : public skiagm::GM {
+public:
+ AnalyticAntiAliasConvexGM() {}
+
+protected:
+
+ SkString onShortName() override {
+ return SkString("analytic_antialias_convex");
+ }
+
+ SkISize onISize() override {
+ return SkISize::Make(W, H);
+ }
+
+ void onDraw(SkCanvas* canvas) override {
+ SkPaint p;
+ p.setColor(SK_ColorRED);
+ p.setAntiAlias(true);
+
+ canvas->clear(0xFFFFFFFF);
+
+ canvas->save();
+
+ SkScalar y = 0;
+
+ canvas->translate(0, y);
+ canvas->rotate(1);
+ canvas->drawRectCoords(20, 20, 200, 200, p);
+ canvas->restore();
+
+ y += 200;
+
+ canvas->translate(0, y);
+ canvas->rotate(1);
+ canvas->drawRectCoords(20, 20, 20.2f, 200, p);
+ canvas->drawRectCoords(20, 200, 200, 200.1f, p);
+ canvas->drawCircle(100, 100, 30, p);
+ canvas->restore();
+ }
+
+private:
+ typedef skiagm::GM INHERITED;
+};
+
+DEF_GM( return new AnalyticAntiAliasConvexGM; )
« no previous file with comments | « no previous file | gm/addarc.cpp » ('j') | gm/addarc.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698