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..7f77172b2e4360f0a6e99fa50d5d98d3da8b6cd0 100644 |
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp |
@@ -93,6 +93,18 @@ bool ImageFrame::copyBitmapData(const ImageFrame& other) |
return other.m_bitmap.copyTo(&m_bitmap, other.m_bitmap.colorType()); |
} |
+void ImageFrame::takeBitmapData(ImageFrame* other) |
+{ |
+ DCHECK(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. |