| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 void make_bitmap() override { | 173 void make_bitmap() override { |
| 174 SkImageDecoder* codec = NULL; | 174 SkImageDecoder* codec = NULL; |
| 175 SkString resourcePath = GetResourcePath(fFilename.c_str()); | 175 SkString resourcePath = GetResourcePath(fFilename.c_str()); |
| 176 SkFILEStream stream(resourcePath.c_str()); | 176 SkFILEStream stream(resourcePath.c_str()); |
| 177 if (stream.isValid()) { | 177 if (stream.isValid()) { |
| 178 codec = SkImageDecoder::Factory(&stream); | 178 codec = SkImageDecoder::Factory(&stream); |
| 179 } | 179 } |
| 180 if (codec) { | 180 if (codec) { |
| 181 stream.rewind(); | 181 stream.rewind(); |
| 182 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe
codePixels_Mode); | 182 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe
codePixels_Mode); |
| 183 SkDELETE(codec); | 183 delete codec; |
| 184 } else { | 184 } else { |
| 185 fBM.allocN32Pixels(1, 1); | 185 fBM.allocN32Pixels(1, 1); |
| 186 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad | 186 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad |
| 187 } | 187 } |
| 188 fSize = fBM.height(); | 188 fSize = fBM.height(); |
| 189 } | 189 } |
| 190 private: | 190 private: |
| 191 typedef DownsampleBitmapGM INHERITED; | 191 typedef DownsampleBitmapGM INHERITED; |
| 192 }; | 192 }; |
| 193 | 193 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kLow_SkFilterQuality)
; ) | 264 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kLow_SkFilterQuality)
; ) |
| 265 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kLow_SkFilterQual
ity); ) | 265 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kLow_SkFilterQual
ity); ) |
| 266 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", | 266 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", |
| 267 kLow_SkFilterQuality); ) | 267 kLow_SkFilterQuality); ) |
| 268 | 268 |
| 269 DEF_GM( return new DownsampleBitmapTextGM(72, kNone_SkFilterQuality); ) | 269 DEF_GM( return new DownsampleBitmapTextGM(72, kNone_SkFilterQuality); ) |
| 270 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kNone_SkFilterQuality
); ) | 270 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kNone_SkFilterQuality
); ) |
| 271 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kNone_SkFilterQua
lity); ) | 271 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kNone_SkFilterQua
lity); ) |
| 272 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", | 272 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", |
| 273 kNone_SkFilterQuality); ) | 273 kNone_SkFilterQuality); ) |
| OLD | NEW |