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

Side by Side Diff: gm/simpleaaclip.cpp

Issue 407183003: add portable and canonical font support for DM (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add atexit; rename to create_... Created 6 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 unified diff | Download patch
« no previous file with comments | « gm/shadertext3.cpp ('k') | gm/srcmode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « gm/shadertext3.cpp ('k') | gm/srcmode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698