OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension); | 55 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension); |
56 canvas->drawBitmap(bm, bmX, bmY); | 56 canvas->drawBitmap(bm, bmX, bmY); |
57 } | 57 } |
58 } | 58 } |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 DEF_SIMPLE_GM(astc_image, canvas, kGMDimension, kGMDimension) { | 62 DEF_SIMPLE_GM(astc_image, canvas, kGMDimension, kGMDimension) { |
63 for (int j = 0; j < 4; ++j) { | 63 for (int j = 0; j < 4; ++j) { |
64 for (int i = 0; i < 4; ++i) { | 64 for (int i = 0; i < 4; ++i) { |
65 SkAutoTUnref<SkImage> image(GetResourceAsImage(get_astc_filename(j*4
+i))); | 65 sk_sp<SkImage> image(GetResourceAsImage(get_astc_filename(j*4+i))); |
66 if (image) { | 66 if (image) { |
67 const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension); | 67 const SkScalar bmX = static_cast<SkScalar>(i*kBitmapDimension); |
68 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension); | 68 const SkScalar bmY = static_cast<SkScalar>(j*kBitmapDimension); |
69 canvas->drawImage(image, bmX, bmY); | 69 canvas->drawImage(image, bmX, bmY); |
70 } | 70 } |
71 } | 71 } |
72 } | 72 } |
73 } | 73 } |
OLD | NEW |