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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp

Issue 2155973002: Save a bitmap copy when advancing to dependent GIF and WebP animation frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: 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.

Powered by Google App Engine
This is Rietveld 408576698