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 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 SkRect::MakeWH(gSize * SK_Scalar1, | 104 SkRect::MakeWH(gSize * SK_Scalar1, |
105 gSize * SK_Scalar1), | 105 gSize * SK_Scalar1), |
106 &paint); | 106 &paint); |
107 canvas->translate(SK_Scalar1 * kPadX / 2, | 107 canvas->translate(SK_Scalar1 * kPadX / 2, |
108 SK_Scalar1 * kPadY / 2); | 108 SK_Scalar1 * kPadY / 2); |
109 SkPaint blackPaint; | 109 SkPaint blackPaint; |
110 SkScalar titleHeight = SK_Scalar1 * 24; | 110 SkScalar titleHeight = SK_Scalar1 * 24; |
111 blackPaint.setColor(SK_ColorBLACK); | 111 blackPaint.setColor(SK_ColorBLACK); |
112 blackPaint.setTextSize(titleHeight); | 112 blackPaint.setTextSize(titleHeight); |
113 blackPaint.setAntiAlias(true); | 113 blackPaint.setAntiAlias(true); |
| 114 sk_tool_utils::set_portable_typeface(&blackPaint); |
114 SkString title; | 115 SkString title; |
115 title.printf("Bitmap size: %d x %d", kBmpSize, kBmpSize); | 116 title.printf("Bitmap size: %d x %d", kBmpSize, kBmpSize); |
116 canvas->drawText(title.c_str(), title.size(), 0, | 117 canvas->drawText(title.c_str(), title.size(), 0, |
117 titleHeight, blackPaint); | 118 titleHeight, blackPaint); |
118 | 119 |
119 canvas->translate(0, SK_Scalar1 * kPadY / 2 + titleHeight); | 120 canvas->translate(0, SK_Scalar1 * kPadY / 2 + titleHeight); |
120 int rowCount = 0; | 121 int rowCount = 0; |
121 canvas->save(); | 122 canvas->save(); |
122 for (int w = 1; w <= kMaxSrcRectSize; w *= 4) { | 123 for (int w = 1; w <= kMaxSrcRectSize; w *= 4) { |
123 for (int h = 1; h <= kMaxSrcRectSize; h *= 4) { | 124 for (int h = 1; h <= kMaxSrcRectSize; h *= 4) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 177 |
177 private: | 178 private: |
178 typedef GM INHERITED; | 179 typedef GM INHERITED; |
179 }; | 180 }; |
180 | 181 |
181 ////////////////////////////////////////////////////////////////////////////// | 182 ////////////////////////////////////////////////////////////////////////////// |
182 | 183 |
183 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } | 184 static GM* MyFactory(void*) { return new DrawBitmapRectGM; } |
184 static GMRegistry reg(MyFactory); | 185 static GMRegistry reg(MyFactory); |
185 } | 186 } |
OLD | NEW |