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

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.cpp

Issue 2202473002: DO NOT COMMIT: Experimental removal of encoded image data Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 3 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/graphics/BitmapImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
index 9f29f85aaeb796b88454c0a80e4bfe5811f8bddc..0e2499801f2f64f0d8ab97072dd6a65f087e1611 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.cpp
@@ -118,6 +118,12 @@ void BitmapImage::destroyDecodedData()
notifyMemoryChanged();
}
+bool BitmapImage::clear()
+{
+ destroyDecodedData();
+ return m_source.clear();
+}
+
PassRefPtr<SharedBuffer> BitmapImage::data()
{
return m_source.data();
@@ -344,6 +350,11 @@ sk_sp<SkImage> BitmapImage::frameAtIndex(size_t index)
if (index == m_cachedFrameIndex && m_cachedFrame)
return m_cachedFrame;
+ if (m_source.isBufferCleared()) {
+ getImageObserver()->requireReloading(this);
+ return nullptr;
+ }
+
return decodeAndCacheFrame(index);
}

Powered by Google App Engine
This is Rietveld 408576698