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

Side by Side Diff: gm/convexpolyclip.cpp

Issue 348323003: use platform-independent font for gm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add include tools for skimage Created 6 years, 6 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/complexclip.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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 SK_ARRAY_COUNT(colors), 47 SK_ARRAY_COUNT(colors),
48 SkShader::kRepeat_TileMode, 48 SkShader::kRepeat_TileMode,
49 0, &mat))->unref(); 49 0, &mat))->unref();
50 canvas.drawRect(rect, paint); 50 canvas.drawRect(rect, paint);
51 rect.inset(wScalar / 8, hScalar / 8); 51 rect.inset(wScalar / 8, hScalar / 8);
52 mat.preTranslate(6 * wScalar, 6 * hScalar); 52 mat.preTranslate(6 * wScalar, 6 * hScalar);
53 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3); 53 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3);
54 } 54 }
55 55
56 paint.setAntiAlias(true); 56 paint.setAntiAlias(true);
57 sk_tool_utils::set_portable_typeface(&paint);
57 paint.setTextSize(wScalar / 2.2f); 58 paint.setTextSize(wScalar / 2.2f);
58 paint.setShader(0); 59 paint.setShader(0);
59 paint.setColor(SK_ColorLTGRAY); 60 paint.setColor(SK_ColorLTGRAY);
60 static const char kTxt[] = "Skia"; 61 static const char kTxt[] = "Skia";
61 SkPoint texPos = { wScalar / 17, hScalar / 2 + paint.getTextSize() / 2.5f }; 62 SkPoint texPos = { wScalar / 17, hScalar / 2 + paint.getTextSize() / 2.5f };
62 canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint); 63 canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint);
63 paint.setColor(SK_ColorBLACK); 64 paint.setColor(SK_ColorBLACK);
64 paint.setStyle(SkPaint::kStroke_Style); 65 paint.setStyle(SkPaint::kStroke_Style);
65 paint.setStrokeWidth(SK_Scalar1); 66 paint.setStrokeWidth(SK_Scalar1);
66 canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint); 67 canvas.drawText(kTxt, SK_ARRAY_COUNT(kTxt)-1, texPos.fX, texPos.fY, paint);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 293
293 SkTLList<Clip> fClips; 294 SkTLList<Clip> fClips;
294 SkBitmap fBmp; 295 SkBitmap fBmp;
295 296
296 typedef GM INHERITED; 297 typedef GM INHERITED;
297 }; 298 };
298 299
299 DEF_GM( return SkNEW(ConvexPolyClip); ) 300 DEF_GM( return SkNEW(ConvexPolyClip); )
300 301
301 } 302 }
OLDNEW
« no previous file with comments | « gm/complexclip.cpp ('k') | gm/cubicpaths.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698