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 #include "SkUnitMappers.h" | 10 #include "SkUnitMappers.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 if (bmp.isNull()) { | 95 if (bmp.isNull()) { |
96 makebm(&bmp, SkBitmap::kARGB_8888_Config, kPointSize / 2, kPointSize
/ 2); | 96 makebm(&bmp, SkBitmap::kARGB_8888_Config, kPointSize / 2, kPointSize
/ 2); |
97 } | 97 } |
98 | 98 |
99 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp, | 99 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(bmp, |
100 SkShader::kMi
rror_TileMode, | 100 SkShader::kMi
rror_TileMode, |
101 SkShader::kRe
peat_TileMode)); | 101 SkShader::kRe
peat_TileMode)); |
102 SkPaint fillPaint; | 102 SkPaint fillPaint; |
103 fillPaint.setAntiAlias(true); | 103 fillPaint.setAntiAlias(true); |
104 fillPaint.setTextSize(SkIntToScalar(kPointSize)); | 104 fillPaint.setTextSize(SkIntToScalar(kPointSize)); |
105 fillPaint.setFilterBitmap(true); | 105 fillPaint.setFilterLevel(SkPaint::kLow_FilterLevel); |
106 fillPaint.setShader(shader); | 106 fillPaint.setShader(shader); |
107 | 107 |
108 SkPaint outlinePaint; | 108 SkPaint outlinePaint; |
109 outlinePaint.setAntiAlias(true); | 109 outlinePaint.setAntiAlias(true); |
110 outlinePaint.setTextSize(SkIntToScalar(kPointSize)); | 110 outlinePaint.setTextSize(SkIntToScalar(kPointSize)); |
111 outlinePaint.setStyle(SkPaint::kStroke_Style); | 111 outlinePaint.setStyle(SkPaint::kStroke_Style); |
112 outlinePaint.setStrokeWidth(0.f); | 112 outlinePaint.setStrokeWidth(0.f); |
113 | 113 |
114 SkScalar w = fillPaint.measureText(kText, kTextLen); | 114 SkScalar w = fillPaint.measureText(kText, kTextLen); |
115 static SkScalar kPadY = 0.5f * kPointSize; | 115 static SkScalar kPadY = 0.5f * kPointSize; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 typedef GM INHERITED; | 213 typedef GM INHERITED; |
214 }; | 214 }; |
215 | 215 |
216 /////////////////////////////////////////////////////////////////////////////// | 216 /////////////////////////////////////////////////////////////////////////////// |
217 | 217 |
218 #ifndef SK_BUILD_FOR_ANDROID | 218 #ifndef SK_BUILD_FOR_ANDROID |
219 static GM* MyFactory(void*) { return new ShaderText2GM; } | 219 static GM* MyFactory(void*) { return new ShaderText2GM; } |
220 static GMRegistry reg(MyFactory); | 220 static GMRegistry reg(MyFactory); |
221 #endif | 221 #endif |
222 } | 222 } |
OLD | NEW |