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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | gm/addarc.cpp » ('j') | gm/addarc.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
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...
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "gm.h"
9 #include "SkPath.h"
10 #include "SkScan.h"
11
12 #define W 800
13 #define H 800
14
15 class AnalyticAntiAliasConvexGM : public skiagm::GM {
16 public:
17 AnalyticAntiAliasConvexGM() {}
18
19 protected:
20
21 SkString onShortName() override {
22 return SkString("analytic_antialias_convex");
23 }
24
25 SkISize onISize() override {
26 return SkISize::Make(W, H);
27 }
28
29 void onDraw(SkCanvas* canvas) override {
30 SkPaint p;
31 p.setColor(SK_ColorRED);
32 p.setAntiAlias(true);
33
34 canvas->clear(0xFFFFFFFF);
35
36 canvas->save();
37
38 SkScalar y = 0;
39
40 canvas->translate(0, y);
41 canvas->rotate(1);
42 canvas->drawRectCoords(20, 20, 200, 200, p);
43 canvas->restore();
44
45 y += 200;
46
47 canvas->translate(0, y);
48 canvas->rotate(1);
49 canvas->drawRectCoords(20, 20, 20.2f, 200, p);
50 canvas->drawRectCoords(20, 200, 200, 200.1f, p);
51 canvas->drawCircle(100, 100, 30, p);
52 canvas->restore();
53 }
54
55 private:
56 typedef skiagm::GM INHERITED;
57 };
58
59 DEF_GM( return new AnalyticAntiAliasConvexGM; )
OLDNEW
« 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