| 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkColor.h" | 10 #include "SkColor.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 // Create a fake ImageDecoder to test setPrefConfigTable for | 142 // Create a fake ImageDecoder to test setPrefConfigTable for |
| 143 // backwards compatibility. | 143 // backwards compatibility. |
| 144 class PrefConfigTestingImageDecoder : public SkImageDecoder { | 144 class PrefConfigTestingImageDecoder : public SkImageDecoder { |
| 145 public: | 145 public: |
| 146 void testPrefConfigTable(skiatest::Reporter* reporter) { | 146 void testPrefConfigTable(skiatest::Reporter* reporter) { |
| 147 // Arbitrary list of Configs. The important thing about | 147 // Arbitrary list of Configs. The important thing about |
| 148 // the list is that each one is different, so we can test | 148 // the list is that each one is different, so we can test |
| 149 // to make sure the correct config is chosen. | 149 // to make sure the correct config is chosen. |
| 150 const SkBitmap::Config configs[] = { | 150 const SkBitmap::Config configs[] = { |
| 151 SkBitmap::kA1_Config, | 151 SkBitmap::kA8_Config, |
| 152 SkBitmap::kA8_Config, | 152 SkBitmap::kA8_Config, |
| 153 SkBitmap::kIndex8_Config, | 153 SkBitmap::kIndex8_Config, |
| 154 SkBitmap::kRGB_565_Config, | 154 SkBitmap::kRGB_565_Config, |
| 155 SkBitmap::kARGB_4444_Config, | 155 SkBitmap::kARGB_4444_Config, |
| 156 SkBitmap::kARGB_8888_Config, | 156 SkBitmap::kARGB_8888_Config, |
| 157 }; | 157 }; |
| 158 this->setPrefConfigTable(configs); | 158 this->setPrefConfigTable(configs); |
| 159 REPORTER_ASSERT(reporter, configs[0] == this->getPrefConfig(kIndex_SrcDe
pth, false)); | 159 REPORTER_ASSERT(reporter, configs[0] == this->getPrefConfig(kIndex_SrcDe
pth, false)); |
| 160 REPORTER_ASSERT(reporter, configs[1] == this->getPrefConfig(kIndex_SrcDe
pth, true)); | 160 REPORTER_ASSERT(reporter, configs[1] == this->getPrefConfig(kIndex_SrcDe
pth, true)); |
| 161 REPORTER_ASSERT(reporter, configs[4] == this->getPrefConfig(k32Bit_SrcDe
pth, false)); | 161 REPORTER_ASSERT(reporter, configs[4] == this->getPrefConfig(k32Bit_SrcDe
pth, false)); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 test_pref_config_table(reporter); | 267 test_pref_config_table(reporter); |
| 268 #ifdef SK_DEBUG | 268 #ifdef SK_DEBUG |
| 269 test_stream_life(); | 269 test_stream_life(); |
| 270 test_row_proc_choice(); | 270 test_row_proc_choice(); |
| 271 #endif | 271 #endif |
| 272 } | 272 } |
| 273 | 273 |
| 274 #include "TestClassDef.h" | 274 #include "TestClassDef.h" |
| 275 DEFINE_TESTCLASS("ImageDecoding", ImageDecodingTestClass, | 275 DEFINE_TESTCLASS("ImageDecoding", ImageDecodingTestClass, |
| 276 test_imageDecodingTests) | 276 test_imageDecodingTests) |
| OLD | NEW |