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

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

Issue 1812273003: Eliminate copies of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
index ce5a2f5813707ffd96d654517ea30ee105322ddf..d5ab5277587f96862a4b2b085a5f566448a563fa 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -162,7 +162,7 @@ void WEBPImageDecoder::clearDecoder()
m_frameBackgroundHasAlpha = false;
}
-void WEBPImageDecoder::onSetData(SharedBuffer*)
+void WEBPImageDecoder::onSetData(SegmentReader*)
{
m_haveAlreadyParsedThisData = false;
}
@@ -202,7 +202,8 @@ bool WEBPImageDecoder::updateDemuxer()
return false; // Await VP8X header so WebPDemuxPartial succeeds.
WebPDemuxDelete(m_demux);
- WebPData inputData = { reinterpret_cast<const uint8_t*>(m_data->data()), m_data->size() };
+ m_encodedData = skia::AdoptRef(m_data->getAsSkData().leakRef());
Peter Kasting 2016/03/23 02:42:59 Is AdoptRef(leakRef()) really the only way to do t
f(malita) 2016/03/23 16:41:58 If we switch to RefPtr, this should simplify to m_
scroggo_chromium 2016/03/24 13:59:46 Done.
+ WebPData inputData = { reinterpret_cast<const uint8_t*>(m_encodedData->data()), m_encodedData->size() };
m_demux = WebPDemuxPartial(&inputData, &m_demuxState);
if (!m_demux || (isAllDataReceived() && m_demuxState != WEBP_DEMUX_DONE))
return setFailed();

Powered by Google App Engine
This is Rietveld 408576698