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

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: 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
Index: Source/web/tests/ImageLayerChromiumTest.cpp
diff --git a/Source/web/tests/ImageLayerChromiumTest.cpp b/Source/web/tests/ImageLayerChromiumTest.cpp
index da06d30a09bd7ac419a91064a62b8846d176acd5..da8b89c1cc137c4162f2bb7ed8cbab5742ec011d 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();
+ m_nativeImage->bitmap().allocN32Pixels(size.width(), size.height(), isOpaque);
reed1 2014/03/21 15:18:40 ASSERT_TRUE() ?
jbroman 2014/03/21 15:39:34 Ditto.
}
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());

Powered by Google App Engine
This is Rietveld 408576698