OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 paint.setColor(color); | 119 paint.setColor(color); |
120 | 120 |
121 SkRect r = SkRect::MakeLTRB(SkIntToScalar(90), SkIntToScalar(90), | 121 SkRect r = SkRect::MakeLTRB(SkIntToScalar(90), SkIntToScalar(90), |
122 SkIntToScalar(180), SkIntToScalar(180)); | 122 SkIntToScalar(180), SkIntToScalar(180)); |
123 | 123 |
124 canvas->drawRect(r, paint); | 124 canvas->drawRect(r, paint); |
125 | 125 |
126 canvas->restore(); | 126 canvas->restore(); |
127 } | 127 } |
128 | 128 |
129 virtual SkString onShortName() { | 129 SkString onShortName() override { |
130 SkString str; | 130 SkString str; |
131 str.printf("simpleaaclip_%s", | 131 str.printf("simpleaaclip_%s", |
132 kRect_GeomType == fGeomType ? "rect" : | 132 kRect_GeomType == fGeomType ? "rect" : |
133 (kPath_GeomType == fGeomType ? "path" : | 133 (kPath_GeomType == fGeomType ? "path" : |
134 "aaclip")); | 134 "aaclip")); |
135 return str; | 135 return str; |
136 } | 136 } |
137 | 137 |
138 virtual SkISize onISize() { | 138 SkISize onISize() override { |
139 return SkISize::Make(640, 480); | 139 return SkISize::Make(640, 480); |
140 } | 140 } |
141 | 141 |
142 virtual void onDraw(SkCanvas* canvas) { | 142 void onDraw(SkCanvas* canvas) override { |
143 | 143 |
144 static const struct { | 144 static const struct { |
145 SkColor fColor; | 145 SkColor fColor; |
146 const char* fName; | 146 const char* fName; |
147 SkRegion::Op fOp; | 147 SkRegion::Op fOp; |
148 } gOps[] = { | 148 } gOps[] = { |
149 { SK_ColorBLACK, "Difference", SkRegion::kDifference_Op }, | 149 { SK_ColorBLACK, "Difference", SkRegion::kDifference_Op }, |
150 { SK_ColorRED, "Intersect", SkRegion::kIntersect_Op }, | 150 { SK_ColorRED, "Intersect", SkRegion::kIntersect_Op }, |
151 { 0xFF008800, "Union", SkRegion::kUnion_Op }, | 151 { 0xFF008800, "Union", SkRegion::kUnion_Op }, |
152 { SK_ColorGREEN, "Rev Diff", SkRegion::kReverseDifference_Op }, | 152 { SK_ColorGREEN, "Rev Diff", SkRegion::kReverseDifference_Op }, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 }; | 194 }; |
195 | 195 |
196 ////////////////////////////////////////////////////////////////////////////// | 196 ////////////////////////////////////////////////////////////////////////////// |
197 | 197 |
198 // rects | 198 // rects |
199 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) | 199 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) |
200 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) | 200 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) |
201 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) | 201 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) |
202 | 202 |
203 } | 203 } |
OLD | NEW |