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

Side by Side Diff: gm/bitmapscroll.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/bitmapfilters.cpp ('k') | gm/bitmapsource.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 2011 Google Inc. 3 * Copyright 2011 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 #include "gm.h" 8 #include "gm.h"
9 9
10 namespace skiagm { 10 namespace skiagm {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 quarterWidth*5/2, quarterHeight*5/2); 102 quarterWidth*5/2, quarterHeight*5/2);
103 x += xSpacing; 103 x += xSpacing;
104 draw9(canvas, x, y, NULL, quarterWidth*9/2, quarterHeight*9/2); 104 draw9(canvas, x, y, NULL, quarterWidth*9/2, quarterHeight*9/2);
105 draw9(canvas, x, y+ySpacing, &scrollCenterRegion, 105 draw9(canvas, x, y+ySpacing, &scrollCenterRegion,
106 quarterWidth*9/2, quarterHeight*9/2); 106 quarterWidth*9/2, quarterHeight*9/2);
107 } 107 }
108 108
109 void drawLabel(SkCanvas* canvas, const char *text, int startX, int startY, 109 void drawLabel(SkCanvas* canvas, const char *text, int startX, int startY,
110 int endX, int endY) { 110 int endX, int endY) {
111 SkPaint paint; 111 SkPaint paint;
112 sk_tool_utils::set_portable_typeface(&paint);
112 paint.setColor(0xFF000000); 113 paint.setColor(0xFF000000);
113 SkPath path; 114 SkPath path;
114 path.moveTo(SkIntToScalar(startX), SkIntToScalar(startY)); 115 path.moveTo(SkIntToScalar(startX), SkIntToScalar(startY));
115 path.lineTo(SkIntToScalar(endX), SkIntToScalar(endY)); 116 path.lineTo(SkIntToScalar(endX), SkIntToScalar(endY));
116 canvas->drawTextOnPath(text, strlen(text), path, NULL, paint); 117 canvas->drawTextOnPath(text, strlen(text), path, NULL, paint);
117 } 118 }
118 119
119 /** Stamp out 9 copies of origBitmap, scrolled in each direction (and 120 /** Stamp out 9 copies of origBitmap, scrolled in each direction (and
120 * not scrolled at all). 121 * not scrolled at all).
121 */ 122 */
(...skipping 27 matching lines...) Expand all
149 static const int quarterHeight = 14; 150 static const int quarterHeight = 14;
150 SkBitmap origBitmap; 151 SkBitmap origBitmap;
151 }; 152 };
152 153
153 ////////////////////////////////////////////////////////////////////////////// 154 //////////////////////////////////////////////////////////////////////////////
154 155
155 static GM* MyFactory(void*) { return new BitmapScrollGM; } 156 static GM* MyFactory(void*) { return new BitmapScrollGM; }
156 static GMRegistry reg(MyFactory); 157 static GMRegistry reg(MyFactory);
157 158
158 } 159 }
OLDNEW
« no previous file with comments | « gm/bitmapfilters.cpp ('k') | gm/bitmapsource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698