OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "Resources.h" | 8 #include "Resources.h" |
9 #include "SkAndroidCodec.h" | 9 #include "SkAndroidCodec.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } else { | 189 } else { |
190 otherAt = kPremul_SkAlphaType; | 190 otherAt = kPremul_SkAlphaType; |
191 } | 191 } |
192 // The other non-opaque alpha type should always succeed, but not ma
tch. | 192 // The other non-opaque alpha type should always succeed, but not ma
tch. |
193 test_android_info(r, codec, info.makeAlphaType(otherAt), expectedRes
ult, nullptr); | 193 test_android_info(r, codec, info.makeAlphaType(otherAt), expectedRes
ult, nullptr); |
194 } | 194 } |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 // FIXME: SkScaledCodec is currently only supported for types used by BRD | 198 // FIXME: SkScaledCodec is currently only supported for types used by BRD |
199 // skbug.com/4428 | 199 // https://bug.skia.org/4428 |
200 static bool supports_scaled_codec(const char path[]) { | 200 static bool supports_scaled_codec(const char path[]) { |
201 static const char* const exts[] = { | 201 static const char* const exts[] = { |
202 "jpg", "jpeg", "png", "webp" | 202 "jpg", "jpeg", "png", "webp" |
203 "JPG", "JPEG", "PNG", "WEBP" | 203 "JPG", "JPEG", "PNG", "WEBP" |
204 }; | 204 }; |
205 | 205 |
206 for (uint32_t i = 0; i < SK_ARRAY_COUNT(exts); i++) { | 206 for (uint32_t i = 0; i < SK_ARRAY_COUNT(exts); i++) { |
207 if (SkStrEndsWith(path, exts[i])) { | 207 if (SkStrEndsWith(path, exts[i])) { |
208 return true; | 208 return true; |
209 } | 209 } |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); | 678 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); |
679 result = decoder->startScanlineDecode( | 679 result = decoder->startScanlineDecode( |
680 decoder->getInfo().makeColorType(kIndex_8_SkColorType)); | 680 decoder->getInfo().makeColorType(kIndex_8_SkColorType)); |
681 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); | 681 REPORTER_ASSERT(r, SkCodec::kInvalidParameters == result); |
682 } | 682 } |
683 | 683 |
684 DEF_TEST(Codec_Params, r) { | 684 DEF_TEST(Codec_Params, r) { |
685 test_invalid_parameters(r, "index8.png"); | 685 test_invalid_parameters(r, "index8.png"); |
686 test_invalid_parameters(r, "mandrill.wbmp"); | 686 test_invalid_parameters(r, "mandrill.wbmp"); |
687 } | 687 } |
OLD | NEW |