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

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

Issue 1001703003: Take NativeImageSkia out behind the woodshed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make bitmapForCurrentFrame() return SkBitmap by value. Created 5 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/platform/graphics/ImageLayerChromiumTest.cpp
diff --git a/Source/platform/graphics/ImageLayerChromiumTest.cpp b/Source/platform/graphics/ImageLayerChromiumTest.cpp
index 974d4d8f9d807aeaeaa54cf5480673b8bd7c0d63..bd19c3269825cf72c3ec663a1d4c2cfa26c0270e 100644
--- a/Source/platform/graphics/ImageLayerChromiumTest.cpp
+++ b/Source/platform/graphics/ImageLayerChromiumTest.cpp
@@ -26,7 +26,6 @@
#include "platform/graphics/Image.h"
#include "platform/graphics/GraphicsLayer.h"
-#include "platform/graphics/skia/NativeImageSkia.h"
#include "wtf/PassOwnPtr.h"
#include <gtest/gtest.h>
@@ -53,10 +52,8 @@ public:
: Image(0)
, m_size(size)
{
- SkBitmap bitmap;
- bitmap.allocN32Pixels(size.width(), size.height(), isOpaque);
- bitmap.eraseColor(SK_ColorTRANSPARENT);
- m_nativeImage = NativeImageSkia::create(bitmap);
+ m_bitmap.allocN32Pixels(size.width(), size.height(), isOpaque);
+ m_bitmap.eraseColor(SK_ColorTRANSPARENT);
}
virtual bool isBitmapImage() const override
@@ -66,7 +63,7 @@ public:
virtual bool currentFrameKnownToBeOpaque() override
{
- return m_nativeImage->bitmap().isOpaque();
+ return m_bitmap.isOpaque();
}
virtual IntSize size() const override
@@ -74,12 +71,12 @@ public:
return m_size;
}
- virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() override
+ virtual SkBitmap bitmapForCurrentFrame() override
{
if (m_size.isZero())
- return nullptr;
+ return SkBitmap();
- return m_nativeImage;
+ return m_bitmap;
}
// Stub implementations of pure virtual Image functions.
@@ -95,7 +92,7 @@ private:
IntSize m_size;
- RefPtr<NativeImageSkia> m_nativeImage;
+ SkBitmap m_bitmap;
};
class GraphicsLayerForTesting : public GraphicsLayer {

Powered by Google App Engine
This is Rietveld 408576698