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

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: Fix assertion 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 2672862d85e13b5b65612075ffccf1ef424f6463..0b8ef11a035a640d9c32083bea64c5b94eff97d9 100644
--- a/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -155,7 +155,7 @@ void WEBPImageDecoder::clearDecoder()
m_frameBackgroundHasAlpha = false;
}
-void WEBPImageDecoder::onSetData(SharedBuffer*)
+void WEBPImageDecoder::onSetData(SegmentReader*)
{
m_haveAlreadyParsedThisData = false;
}
@@ -195,7 +195,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 = m_data->getAsSkData();
Peter Kasting 2016/03/25 06:24:37 We never reset this anywhere; won't this mean we n
scroggo 2016/03/25 15:49:53 That looks correct. I've updated the code to clear
+ 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