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

Unified Diff: Source/web/tests/ImageLayerChromiumTest.cpp

Issue 204353005: Remove use of SkBitmap::Config (deprecated) from Source/web/tests/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add EXPECT_TRUE in two places ASSERT_TRUE does not work 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/web/tests/GraphicsContextTest.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/tests/ImageLayerChromiumTest.cpp
diff --git a/Source/web/tests/ImageLayerChromiumTest.cpp b/Source/web/tests/ImageLayerChromiumTest.cpp
index da06d30a09bd7ac419a91064a62b8846d176acd5..66f0864bc0e4f36c6ddc096c85f790d68671c247 100644
--- a/Source/web/tests/ImageLayerChromiumTest.cpp
+++ b/Source/web/tests/ImageLayerChromiumTest.cpp
@@ -45,18 +45,17 @@ class MockGraphicsLayerClient : public GraphicsLayerClient {
class TestImage : public Image {
public:
- static PassRefPtr<TestImage> create(const IntSize& size, SkAlphaType alphaType)
+ static PassRefPtr<TestImage> create(const IntSize& size, bool isOpaque)
{
- return adoptRef(new TestImage(size, alphaType));
+ return adoptRef(new TestImage(size, isOpaque));
}
- explicit TestImage(const IntSize& size, SkAlphaType alphaType)
+ explicit TestImage(const IntSize& size, bool isOpaque)
: Image(0)
, m_size(size)
{
m_nativeImage = NativeImageSkia::create();
- m_nativeImage->bitmap().setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height(), 0, alphaType);
- m_nativeImage->bitmap().allocPixels();
+ EXPECT_TRUE(m_nativeImage->bitmap().allocN32Pixels(size.width(), size.height(), isOpaque));
}
virtual bool isBitmapImage() const OVERRIDE
@@ -112,9 +111,9 @@ TEST(ImageLayerChromiumTest, opaqueImages)
OwnPtr<GraphicsLayerForTesting> graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&client));
ASSERT_TRUE(graphicsLayer.get());
- RefPtr<Image> opaqueImage = TestImage::create(IntSize(100, 100), kOpaque_SkAlphaType);
+ RefPtr<Image> opaqueImage = TestImage::create(IntSize(100, 100), true /* opaque */);
ASSERT_TRUE(opaqueImage.get());
- RefPtr<Image> nonOpaqueImage = TestImage::create(IntSize(100, 100), kPremul_SkAlphaType);
+ RefPtr<Image> nonOpaqueImage = TestImage::create(IntSize(100, 100), false /* opaque */);
ASSERT_TRUE(nonOpaqueImage.get());
ASSERT_FALSE(graphicsLayer->contentsLayer());
« no previous file with comments | « Source/web/tests/GraphicsContextTest.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698