| 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" |
| 11 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 12 #include "SkData.h" | 12 #include "SkData.h" |
| 13 #include "SkImage.h" |
| 13 #include "SkImageGenerator.h" | 14 #include "SkImageGenerator.h" |
| 14 #include "SkImageDecoder.h" | |
| 15 #include "SkOSFile.h" | 15 #include "SkOSFile.h" |
| 16 #include "SkTextureCompressor.h" | 16 #include "SkTextureCompressor.h" |
| 17 | 17 |
| 18 static const char *kASTCFilenames[] = { | 18 static const char *kASTCFilenames[] = { |
| 19 "mandrill_128x128_4x4.astc", // kASTC_4x4_Format | 19 "mandrill_128x128_4x4.astc", // kASTC_4x4_Format |
| 20 "mandrill_130x128_5x4.astc", // kASTC_5x4_Format | 20 "mandrill_130x128_5x4.astc", // kASTC_5x4_Format |
| 21 "mandrill_130x130_5x5.astc", // kASTC_5x5_Format | 21 "mandrill_130x130_5x5.astc", // kASTC_5x5_Format |
| 22 "mandrill_132x130_6x5.astc", // kASTC_6x5_Format | 22 "mandrill_132x130_6x5.astc", // kASTC_6x5_Format |
| 23 "mandrill_132x132_6x6.astc", // kASTC_6x6_Format | 23 "mandrill_132x132_6x6.astc", // kASTC_6x6_Format |
| 24 "mandrill_128x130_8x5.astc", // kASTC_8x5_Format | 24 "mandrill_128x130_8x5.astc", // kASTC_8x5_Format |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 SkAutoTUnref<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 |