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

Side by Side Diff: gm/convexpolyclip.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/colortype.cpp ('k') | gm/cubicpaths.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "gm.h" 9 #include "gm.h"
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 bgPaint.setAlpha(0x15); 143 bgPaint.setAlpha(0x15);
144 SkISize size = canvas->getDeviceSize(); 144 SkISize size = canvas->getDeviceSize();
145 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(size.fWidth), 145 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(size.fWidth),
146 SkIntToScalar(size.fHeight)); 146 SkIntToScalar(size.fHeight));
147 canvas->drawBitmapRectToRect(fBmp, NULL, dstRect, &bgPaint); 147 canvas->drawBitmapRectToRect(fBmp, NULL, dstRect, &bgPaint);
148 148
149 static const char kTxt[] = "Clip Me!"; 149 static const char kTxt[] = "Clip Me!";
150 SkPaint txtPaint; 150 SkPaint txtPaint;
151 txtPaint.setTextSize(23.f); 151 txtPaint.setTextSize(23.f);
152 txtPaint.setAntiAlias(true); 152 txtPaint.setAntiAlias(true);
153 sk_tool_utils::set_portable_typeface(&txtPaint);
153 txtPaint.setColor(SK_ColorDKGRAY); 154 txtPaint.setColor(SK_ColorDKGRAY);
154 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); 155 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1);
155 156
156 SkScalar startX = 0; 157 SkScalar startX = 0;
157 int testLayers = kBench_Mode != this->getMode(); 158 int testLayers = kBench_Mode != this->getMode();
158 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) { 159 for (int doLayer = 0; doLayer <= testLayers; ++doLayer) {
159 for (SkTLList<Clip>::Iter iter(fClips, SkTLList<Clip>::Iter::kHead_I terStart); 160 for (SkTLList<Clip>::Iter iter(fClips, SkTLList<Clip>::Iter::kHead_I terStart);
160 NULL != iter.get(); 161 NULL != iter.get();
161 iter.next()) { 162 iter.next()) {
162 const Clip* clip = iter.get(); 163 const Clip* clip = iter.get();
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 294
294 SkTLList<Clip> fClips; 295 SkTLList<Clip> fClips;
295 SkBitmap fBmp; 296 SkBitmap fBmp;
296 297
297 typedef GM INHERITED; 298 typedef GM INHERITED;
298 }; 299 };
299 300
300 DEF_GM( return SkNEW(ConvexPolyClip); ) 301 DEF_GM( return SkNEW(ConvexPolyClip); )
301 302
302 } 303 }
OLDNEW
« no previous file with comments | « gm/colortype.cpp ('k') | gm/cubicpaths.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698