Index: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
index 1390439648a4bbd767300fe45c3ee736ab1ead0f..1c2546b46f9b2e9ead2029a2f0bf131a46a61113 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
@@ -93,6 +93,17 @@ bool ImageFrame::copyBitmapData(const ImageFrame& other) |
return other.m_bitmap.copyTo(&m_bitmap, other.m_bitmap.colorType()); |
} |
+void ImageFrame::takeBitmapData(ImageFrame& other) |
+{ |
+ if (this == &other) |
+ return; |
+ |
+ m_hasAlpha = other.m_hasAlpha; |
+ m_bitmap.reset(); |
+ m_bitmap.swap(other.m_bitmap); |
+ other.m_status = FrameEmpty; |
+} |
+ |
bool ImageFrame::setSize(int newWidth, int newHeight) |
{ |
// setSize() should only be called once, it leaks memory otherwise. |