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 "Resources.h" | 8 #include "Resources.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 continue; | 316 continue; |
317 } | 317 } |
318 | 318 |
319 REPORTER_ASSERT(reporter, bm.width() == 1 && bm.height() == 1); | 319 REPORTER_ASSERT(reporter, bm.width() == 1 && bm.height() == 1); |
320 { | 320 { |
321 SkAutoLockPixels alp(bm); | 321 SkAutoLockPixels alp(bm); |
322 REPORTER_ASSERT(reporter, bm.getAddr32(0, 0)[0] == 0x7f7f7f7f); | 322 REPORTER_ASSERT(reporter, bm.getAddr32(0, 0)[0] == 0x7f7f7f7f); |
323 } | 323 } |
324 } | 324 } |
325 } | 325 } |
326 #endif // SK_BUILD_FOR_UNIX/ANDROID skbug.com/2388 | 326 #endif // SK_BUILD_FOR_UNIX/ANDROID https://bug.skia.org/2388 |
327 | 327 |
328 #ifdef SK_DEBUG | 328 #ifdef SK_DEBUG |
329 // Test inside SkScaledBitmapSampler.cpp | 329 // Test inside SkScaledBitmapSampler.cpp |
330 extern void test_row_proc_choice(); | 330 extern void test_row_proc_choice(); |
331 #endif // SK_DEBUG | 331 #endif // SK_DEBUG |
332 | 332 |
333 DEF_TEST(ImageDecoding, reporter) { | 333 DEF_TEST(ImageDecoding, reporter) { |
334 test_unpremul(reporter); | 334 test_unpremul(reporter); |
335 #ifdef SK_DEBUG | 335 #ifdef SK_DEBUG |
336 test_row_proc_choice(); | 336 test_row_proc_choice(); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 new SingleAllocator((void*)pixels.get(), sizeof(uint16_t) * pixelCou
nt)); | 723 new SingleAllocator((void*)pixels.get(), sizeof(uint16_t) * pixelCou
nt)); |
724 decoder->setAllocator(allocator); | 724 decoder->setAllocator(allocator); |
725 decoder->setSampleSize(2); | 725 decoder->setSampleSize(2); |
726 SkBitmap bitmap; | 726 SkBitmap bitmap; |
727 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType, | 727 bool success = decoder->decode(stream, &bitmap, kRGB_565_SkColorType, |
728 SkImageDecoder::kDecodePixels_Mode) != SkImag
eDecoder::kFailure; | 728 SkImageDecoder::kDecodePixels_Mode) != SkImag
eDecoder::kFailure; |
729 REPORTER_ASSERT(r, success); | 729 REPORTER_ASSERT(r, success); |
730 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory | 730 REPORTER_ASSERT(r, !allocator->ready()); // Decoder used correct memory |
731 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]); | 731 REPORTER_ASSERT(r, sentinal == pixels[pixelCount]); |
732 } | 732 } |
OLD | NEW |