| 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" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 protected: | 190 protected: |
| 191 SkString fFilename; | 191 SkString fFilename; |
| 192 int fSize; | 192 int fSize; |
| 193 | 193 |
| 194 SkScalar getScale() override { | 194 SkScalar getScale() override { |
| 195 return 192.f/fSize; | 195 return 192.f/fSize; |
| 196 } | 196 } |
| 197 | 197 |
| 198 void makeBitmap() override { | 198 void makeBitmap() override { |
| 199 SkImageDecoder* codec = NULL; | 199 SkImageDecoder* codec = nullptr; |
| 200 SkString resourcePath = GetResourcePath(fFilename.c_str()); | 200 SkString resourcePath = GetResourcePath(fFilename.c_str()); |
| 201 SkFILEStream stream(resourcePath.c_str()); | 201 SkFILEStream stream(resourcePath.c_str()); |
| 202 if (stream.isValid()) { | 202 if (stream.isValid()) { |
| 203 codec = SkImageDecoder::Factory(&stream); | 203 codec = SkImageDecoder::Factory(&stream); |
| 204 } | 204 } |
| 205 if (codec) { | 205 if (codec) { |
| 206 stream.rewind(); | 206 stream.rewind(); |
| 207 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe
codePixels_Mode); | 207 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe
codePixels_Mode); |
| 208 delete codec; | 208 delete codec; |
| 209 } else { | 209 } else { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 234 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) | 234 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) |
| 235 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) | 235 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) |
| 236 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) | 236 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) |
| 237 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) | 237 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) |
| 238 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) | 238 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) |
| 239 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png", true); ) | 239 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png", true); ) |
| 240 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) | 240 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) |
| 241 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) | 241 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) |
| 242 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) | 242 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) |
| 243 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); ) | 243 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); ) |
| OLD | NEW |