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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 * SkInstallDiscardablePixelRef functions. | 502 * SkInstallDiscardablePixelRef functions. |
503 */ | 503 */ |
504 DEF_TEST(ImprovedBitmapFactory, reporter) { | 504 DEF_TEST(ImprovedBitmapFactory, reporter) { |
505 SkString resourcePath = skiatest::Test::GetResourcePath(); | 505 SkString resourcePath = skiatest::Test::GetResourcePath(); |
506 SkString path = SkOSPath::SkPathJoin( | 506 SkString path = SkOSPath::SkPathJoin( |
507 resourcePath.c_str(), "randPixels.png"); | 507 resourcePath.c_str(), "randPixels.png"); |
508 SkAutoTUnref<SkStreamRewindable> stream( | 508 SkAutoTUnref<SkStreamRewindable> stream( |
509 SkStream::NewFromFile(path.c_str())); | 509 SkStream::NewFromFile(path.c_str())); |
510 if (sk_exists(path.c_str())) { | 510 if (sk_exists(path.c_str())) { |
511 SkBitmap bm; | 511 SkBitmap bm; |
512 SkAssertResult(bm.setConfig(SkImageInfo::MakeN32Premul(1, 1))); | 512 SkAssertResult(bm.setInfo(SkImageInfo::MakeN32Premul(1, 1))); |
513 REPORTER_ASSERT(reporter, | 513 REPORTER_ASSERT(reporter, |
514 NULL != install_pixel_ref(&bm, stream.detach(), 1, true)); | 514 NULL != install_pixel_ref(&bm, stream.detach(), 1, true)); |
515 SkAutoLockPixels alp(bm); | 515 SkAutoLockPixels alp(bm); |
516 REPORTER_ASSERT(reporter, NULL != bm.getPixels()); | 516 REPORTER_ASSERT(reporter, NULL != bm.getPixels()); |
517 } | 517 } |
518 } | 518 } |
519 | 519 |
520 | 520 |
521 //////////////////////////////////////////////////////////////////////////////// | 521 //////////////////////////////////////////////////////////////////////////////// |
522 | 522 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 719 } |
720 SkDecodingImageGenerator::Options options(scaleList[i], | 720 SkDecodingImageGenerator::Options options(scaleList[i], |
721 ditherList[j]); | 721 ditherList[j]); |
722 test_options(reporter, options, encodedStream, encodedData, | 722 test_options(reporter, options, encodedStream, encodedData, |
723 useDataList[m], path); | 723 useDataList[m], path); |
724 } | 724 } |
725 } | 725 } |
726 } | 726 } |
727 } | 727 } |
728 } | 728 } |
OLD | NEW |