| 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 | 9 |
| 10 #include "Resources.h" | 10 #include "Resources.h" |
| 11 #include "SkGradientShader.h" | 11 #include "SkGradientShader.h" |
| 12 #include "SkImageDecoder.h" | 12 #include "SkImageDecoder.h" |
| 13 #include "SkStream.h" | 13 #include "SkStream.h" |
| 14 #include "SkTypeface.h" | 14 #include "SkTypeface.h" |
| 15 | 15 |
| 16 static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style sty
le) { | 16 static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style sty
le) { |
| 17 SkSafeUnref(paint->setTypeface(SkTypeface::CreateFromName(name, style))); | 17 sk_tool_utils::set_portable_typeface(paint, name, style); |
| 18 } | 18 } |
| 19 | 19 |
| 20 static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) { | 20 static SkSize computeSize(const SkBitmap& bm, const SkMatrix& mat) { |
| 21 SkRect bounds = SkRect::MakeWH(SkIntToScalar(bm.width()), | 21 SkRect bounds = SkRect::MakeWH(SkIntToScalar(bm.width()), |
| 22 SkIntToScalar(bm.height())); | 22 SkIntToScalar(bm.height())); |
| 23 mat.mapRect(&bounds); | 23 mat.mapRect(&bounds); |
| 24 return SkSize::Make(bounds.width(), bounds.height()); | 24 return SkSize::Make(bounds.width(), bounds.height()); |
| 25 } | 25 } |
| 26 | 26 |
| 27 static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat,
SkScalar dx) { | 27 static void draw_row(SkCanvas* canvas, const SkBitmap& bm, const SkMatrix& mat,
SkScalar dx) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); ) | 223 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); ) |
| 224 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) | 224 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) |
| 225 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) | 225 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) |
| 226 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) | 226 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) |
| 227 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) | 227 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) |
| 228 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) | 228 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) |
| 229 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) | 229 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) |
| 230 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) | 230 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) |
| 231 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) | 231 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) |
| 232 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) | 232 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) |
| OLD | NEW |