OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "gm.h" | 7 #include "gm.h" |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkGradientShader.h" | 9 #include "SkGradientShader.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 static SkBitmap bmp; | 86 static SkBitmap bmp; |
87 if (bmp.isNull()) { | 87 if (bmp.isNull()) { |
88 makebm(&bmp, kPointSize / 2, kPointSize / 2); | 88 makebm(&bmp, kPointSize / 2, kPointSize / 2); |
89 } | 89 } |
90 | 90 |
91 SkPaint fillPaint; | 91 SkPaint fillPaint; |
92 fillPaint.setAntiAlias(true); | 92 fillPaint.setAntiAlias(true); |
93 sk_tool_utils::set_portable_typeface(&fillPaint); | 93 sk_tool_utils::set_portable_typeface(&fillPaint); |
94 fillPaint.setTextSize(SkIntToScalar(kPointSize)); | 94 fillPaint.setTextSize(SkIntToScalar(kPointSize)); |
95 fillPaint.setFilterLevel(SkPaint::kLow_FilterLevel); | 95 fillPaint.setFilterQuality(kLow_SkFilterQuality); |
96 | 96 |
97 SkPaint outlinePaint; | 97 SkPaint outlinePaint; |
98 outlinePaint.setAntiAlias(true); | 98 outlinePaint.setAntiAlias(true); |
99 sk_tool_utils::set_portable_typeface(&outlinePaint); | 99 sk_tool_utils::set_portable_typeface(&outlinePaint); |
100 outlinePaint.setTextSize(SkIntToScalar(kPointSize)); | 100 outlinePaint.setTextSize(SkIntToScalar(kPointSize)); |
101 outlinePaint.setStyle(SkPaint::kStroke_Style); | 101 outlinePaint.setStyle(SkPaint::kStroke_Style); |
102 outlinePaint.setStrokeWidth(0.f); | 102 outlinePaint.setStrokeWidth(0.f); |
103 | 103 |
104 SkScalar w = fillPaint.measureText(kText, kTextLen); | 104 SkScalar w = fillPaint.measureText(kText, kTextLen); |
105 static SkScalar kPadY = 0.5f * kPointSize; | 105 static SkScalar kPadY = 0.5f * kPointSize; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 private: | 202 private: |
203 typedef GM INHERITED; | 203 typedef GM INHERITED; |
204 }; | 204 }; |
205 | 205 |
206 /////////////////////////////////////////////////////////////////////////////// | 206 /////////////////////////////////////////////////////////////////////////////// |
207 | 207 |
208 static GM* MyFactory(void*) { return new ShaderText2GM; } | 208 static GM* MyFactory(void*) { return new ShaderText2GM; } |
209 static GMRegistry reg(MyFactory); | 209 static GMRegistry reg(MyFactory); |
210 } | 210 } |
OLD | NEW |