| 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 | 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 SkRect::MakeWH(gSize * SK_Scalar1, | 156 SkRect::MakeWH(gSize * SK_Scalar1, |
| 157 gSize * SK_Scalar1), | 157 gSize * SK_Scalar1), |
| 158 &paint); | 158 &paint); |
| 159 canvas->translate(SK_Scalar1 * kPadX / 2, | 159 canvas->translate(SK_Scalar1 * kPadX / 2, |
| 160 SK_Scalar1 * kPadY / 2); | 160 SK_Scalar1 * kPadY / 2); |
| 161 SkPaint blackPaint; | 161 SkPaint blackPaint; |
| 162 SkScalar titleHeight = SK_Scalar1 * 24; | 162 SkScalar titleHeight = SK_Scalar1 * 24; |
| 163 blackPaint.setColor(SK_ColorBLACK); | 163 blackPaint.setColor(SK_ColorBLACK); |
| 164 blackPaint.setTextSize(titleHeight); | 164 blackPaint.setTextSize(titleHeight); |
| 165 blackPaint.setAntiAlias(true); | 165 blackPaint.setAntiAlias(true); |
| 166 sk_tool_utils::set_portable_typeface(&blackPaint); | 166 sk_tool_utils::set_portable_typeface_always(&blackPaint); |
| 167 SkString title; | 167 SkString title; |
| 168 title.printf("Bitmap size: %d x %d", gBmpSize, gBmpSize); | 168 title.printf("Bitmap size: %d x %d", gBmpSize, gBmpSize); |
| 169 canvas->drawText(title.c_str(), title.size(), 0, | 169 canvas->drawText(title.c_str(), title.size(), 0, |
| 170 titleHeight, blackPaint); | 170 titleHeight, blackPaint); |
| 171 | 171 |
| 172 canvas->translate(0, SK_Scalar1 * kPadY / 2 + titleHeight); | 172 canvas->translate(0, SK_Scalar1 * kPadY / 2 + titleHeight); |
| 173 int rowCount = 0; | 173 int rowCount = 0; |
| 174 canvas->save(); | 174 canvas->save(); |
| 175 for (int w = 1; w <= kMaxSrcRectSize; w *= 4) { | 175 for (int w = 1; w <= kMaxSrcRectSize; w *= 4) { |
| 176 for (int h = 1; h <= kMaxSrcRectSize; h *= 4) { | 176 for (int h = 1; h <= kMaxSrcRectSize; h *= 4) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 private: | 228 private: |
| 229 typedef skiagm::GM INHERITED; | 229 typedef skiagm::GM INHERITED; |
| 230 }; | 230 }; |
| 231 | 231 |
| 232 DEF_GM( return new DrawBitmapRectGM(canvasproc, NULL); ) | 232 DEF_GM( return new DrawBitmapRectGM(canvasproc, NULL); ) |
| 233 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) | 233 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) |
| 234 DEF_GM( return new DrawBitmapRectGM(imagescaleproc, "-imagescale"); ) | 234 DEF_GM( return new DrawBitmapRectGM(imagescaleproc, "-imagescale"); ) |
| OLD | NEW |