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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 { SK_ColorBLACK, "Difference", SkRegion::kDifference_Op }, | 147 { SK_ColorBLACK, "Difference", SkRegion::kDifference_Op }, |
148 { SK_ColorRED, "Intersect", SkRegion::kIntersect_Op }, | 148 { SK_ColorRED, "Intersect", SkRegion::kIntersect_Op }, |
149 { 0xFF008800, "Union", SkRegion::kUnion_Op }, | 149 { 0xFF008800, "Union", SkRegion::kUnion_Op }, |
150 { SK_ColorGREEN, "Rev Diff", SkRegion::kReverseDifference_Op }, | 150 { SK_ColorGREEN, "Rev Diff", SkRegion::kReverseDifference_Op }, |
151 { SK_ColorYELLOW, "Replace", SkRegion::kReplace_Op }, | 151 { SK_ColorYELLOW, "Replace", SkRegion::kReplace_Op }, |
152 { SK_ColorBLUE, "XOR", SkRegion::kXOR_Op }, | 152 { SK_ColorBLUE, "XOR", SkRegion::kXOR_Op }, |
153 }; | 153 }; |
154 | 154 |
155 SkPaint textPaint; | 155 SkPaint textPaint; |
156 textPaint.setAntiAlias(true); | 156 textPaint.setAntiAlias(true); |
| 157 sk_tool_utils::set_portable_typeface(&textPaint); |
157 textPaint.setTextSize(SK_Scalar1*24); | 158 textPaint.setTextSize(SK_Scalar1*24); |
158 int xOff = 0; | 159 int xOff = 0; |
159 | 160 |
160 for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); op++) { | 161 for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); op++) { |
161 canvas->drawText(gOps[op].fName, strlen(gOps[op].fName), | 162 canvas->drawText(gOps[op].fName, strlen(gOps[op].fName), |
162 SkIntToScalar(75), SkIntToScalar(50), | 163 SkIntToScalar(75), SkIntToScalar(50), |
163 textPaint); | 164 textPaint); |
164 | 165 |
165 if (kAAClip_GeomType == fGeomType) { | 166 if (kAAClip_GeomType == fGeomType) { |
166 this->drawRgnOped(canvas, gOps[op].fOp, gOps[op].fColor); | 167 this->drawRgnOped(canvas, gOps[op].fOp, gOps[op].fColor); |
(...skipping 24 matching lines...) Expand all Loading... |
191 }; | 192 }; |
192 | 193 |
193 ////////////////////////////////////////////////////////////////////////////// | 194 ////////////////////////////////////////////////////////////////////////////// |
194 | 195 |
195 // rects | 196 // rects |
196 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) | 197 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) |
197 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) | 198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) |
198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) | 199 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) |
199 | 200 |
200 } | 201 } |
OLD | NEW |