OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |