Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp

Issue 1813483002: ImagePixelLocker now manually allocates SkPixmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/skia/ImagePixelLocker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
index bee0908076ff0bd6a3ed8202d4d0c6a4bca7fce3..28b31ff209fb98cfdd1606ba7efc242e3f281356 100644
--- a/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp
@@ -345,8 +345,12 @@ TEST_F(DeferredImageDecoderTest, frameOpacity)
decoder->setData(*m_data, true);
SkImageInfo pixInfo = SkImageInfo::MakeN32Premul(1, 1);
- SkAutoPixmapStorage pixels;
- pixels.alloc(pixInfo);
+
+ size_t rowBytes = pixInfo.minRowBytes();
+ size_t size = pixInfo.getSafeSize(rowBytes);
+
+ SkAutoMalloc storage(size);
+ SkPixmap pixmap(pixInfo, storage.get(), rowBytes);
// Before decoding, the frame is not known to be opaque.
RefPtr<SkImage> frame = decoder->createFrameAtIndex(0);
@@ -354,7 +358,7 @@ TEST_F(DeferredImageDecoderTest, frameOpacity)
EXPECT_FALSE(frame->isOpaque());
// Force a lazy decode by reading pixels.
- EXPECT_TRUE(frame->readPixels(pixels, 0, 0));
+ EXPECT_TRUE(frame->readPixels(pixmap, 0, 0));
// After decoding, the frame is known to be opaque.
frame = decoder->createFrameAtIndex(0);
@@ -362,7 +366,7 @@ TEST_F(DeferredImageDecoderTest, frameOpacity)
EXPECT_TRUE(frame->isOpaque());
// Re-generating the opaque-marked frame should not fail.
- EXPECT_TRUE(frame->readPixels(pixels, 0, 0));
+ EXPECT_TRUE(frame->readPixels(pixmap, 0, 0));
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/skia/ImagePixelLocker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698