aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CachedDecodingPixelRefTest.cpp
diff options
context:
space:
mode:
authorGravatar halcanary <halcanary@google.com>2014-08-12 09:07:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-12 09:07:08 -0700
commit78ee93f5454c93136efff5970553ac6105950247 (patch)
treeb30c3ea090050afc63b5bc23073e40ef5c2c4499 /tests/CachedDecodingPixelRefTest.cpp
parent35fbd014e3dd2b4e1813389da6dfa2d3482dfb67 (diff)
Revert of SkImage::NewFromGenerator(SkImageGenerator*), and a unit test. (https://codereview.chromium.org/465823003/)
Reason for revert: Mac bots are failing Original issue's description: > SkImage::NewFromGenerator(SkImageGenerator*), and a unit test. > > Committed: https://skia.googlesource.com/skia/+/186f7b04956a1742f185a4ca69b44b52bc50e7fc R=reed@google.com TBR=reed@google.com NOTREECHECKS=true NOTRY=true Author: halcanary@google.com Review URL: https://codereview.chromium.org/453723003
Diffstat (limited to 'tests/CachedDecodingPixelRefTest.cpp')
-rw-r--r--tests/CachedDecodingPixelRefTest.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index b409987392..8de7da79a2 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -322,42 +322,3 @@ DEF_TEST(DiscardableAndCachingPixelRef, reporter) {
check_pixelref(TestImageGenerator::kSucceedGetPixels_TestType,
reporter, kSkDiscardable_PixelRefType, globalPool);
}
-
-////////////////////////////////////////////////////////////////////////////////
-
-DEF_TEST(Image_NewFromGenerator, r) {
- TestImageGenerator::TestType testTypes[] = {
- TestImageGenerator::kFailGetInfo_TestType,
- TestImageGenerator::kFailGetPixels_TestType,
- TestImageGenerator::kSucceedGetPixels_TestType,
- };
- for (size_t i = 0; i < SK_ARRAY_COUNT(testTypes); ++i) {
- TestImageGenerator::TestType test = testTypes[i];
- SkImageGenerator* gen = SkNEW_ARGS(TestImageGenerator, (test, r));
- SkAutoTUnref<SkImage> image(SkImage::NewFromGenerator(gen));
- if (TestImageGenerator::kFailGetInfo_TestType == test) {
- REPORTER_ASSERT(r, NULL == image.get());
- continue;
- }
- if (NULL == image.get()) {
- ERRORF(r, "SkImage::NewFromGenerator unexpecedly failed ["
- SK_SIZE_T_SPECIFIER "]", i);
- continue;
- }
- REPORTER_ASSERT(r, TestImageGenerator::Width() == image->width());
- REPORTER_ASSERT(r, TestImageGenerator::Height() == image->height());
-
- SkBitmap bitmap;
- SkAssertResult(bitmap.allocN32Pixels(TestImageGenerator::Width(),
- TestImageGenerator::Height()));
- SkCanvas canvas(bitmap);
- canvas.clear(SK_ColorMAGENTA);
- image->draw(&canvas, 0, 0, NULL);
- SkColor color = bitmap.getColor(0, 0);
- if (TestImageGenerator::kSucceedGetPixels_TestType == test) {
- REPORTER_ASSERT(r, TestImageGenerator::Color() == color);
- } else {
- REPORTER_ASSERT(r, SK_ColorMAGENTA == color);
- }
- }
-}