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

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

Issue 201213002: Remove uses of SkBitmap::Config (deprecated) from core/ and platform/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: schenney comments Created 6 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 | « Source/platform/DragImage.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/DeferredImageDecoderTest.cpp
diff --git a/Source/platform/graphics/DeferredImageDecoderTest.cpp b/Source/platform/graphics/DeferredImageDecoderTest.cpp
index e98d804ec2207d444c6bbc07014c8759ad336ae2..757cfc4a409b172d58868588f7df4055ecd308fb 100644
--- a/Source/platform/graphics/DeferredImageDecoderTest.cpp
+++ b/Source/platform/graphics/DeferredImageDecoderTest.cpp
@@ -59,12 +59,6 @@ const unsigned char whitePNG[] = {
0x42, 0x60, 0x82,
};
-static SkCanvas* createRasterCanvas(int width, int height)
-{
- SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(SkBitmap::kARGB_8888_Config, width, height));
- return new SkCanvas(device);
-}
-
struct Rasterizer {
SkCanvas* canvas;
SkPicture* picture;
@@ -83,7 +77,8 @@ public:
m_actualDecoder = decoder.get();
m_actualDecoder->setSize(1, 1);
m_lazyDecoder = DeferredImageDecoder::createForTesting(decoder.release());
- m_canvas.reset(createRasterCanvas(100, 100));
+ m_canvas.reset(SkCanvas::NewRasterN32(100, 100));
+ ASSERT_TRUE(m_canvas);
m_frameBufferRequestCount = 0;
m_frameCount = 1;
m_repetitionCount = cAnimationNone;
@@ -170,7 +165,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPicture)
EXPECT_EQ(0, m_frameBufferRequestCount);
SkBitmap canvasBitmap;
- canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
+ ASSERT_TRUE(canvasBitmap.allocN32Pixels(100, 100));
ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
SkAutoLockPixels autoLock(canvasBitmap);
EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
@@ -197,7 +192,7 @@ TEST_F(DeferredImageDecoderTest, drawIntoSkPictureProgressive)
m_canvas->drawPicture(m_picture);
SkBitmap canvasBitmap;
- canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
+ ASSERT_TRUE(canvasBitmap.allocN32Pixels(100, 100));
ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
SkAutoLockPixels autoLock(canvasBitmap);
EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
@@ -229,7 +224,7 @@ TEST_F(DeferredImageDecoderTest, decodeOnOtherThread)
EXPECT_EQ(0, m_frameBufferRequestCount);
SkBitmap canvasBitmap;
- canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
+ ASSERT_TRUE(canvasBitmap.allocN32Pixels(100, 100));
ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0));
SkAutoLockPixels autoLock(canvasBitmap);
EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0));
« no previous file with comments | « Source/platform/DragImage.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698