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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

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/ImageDecoder.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
index 2ebd7797caf99844abc34018d95e42f885f8b453..cb0d9250b7f3b9d708a939849548ccb50631a5d0 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -29,10 +29,10 @@
#include "SkColorPriv.h"
#include "platform/PlatformExport.h"
-#include "platform/SharedBuffer.h"
#include "platform/graphics/ImageOrientation.h"
#include "platform/image-decoders/ImageAnimation.h"
#include "platform/image-decoders/ImageFrame.h"
+#include "platform/image-decoders/SegmentReader.h"
#include "public/platform/Platform.h"
#include "wtf/Assertions.h"
#include "wtf/PassOwnPtr.h"
@@ -99,13 +99,13 @@ public:
// we can't sniff a supported type from the provided data (possibly
// because there isn't enough data yet).
// Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes().
- static PassOwnPtr<ImageDecoder> create(const SharedBuffer& data, AlphaOption, GammaAndColorProfileOption);
+ static PassOwnPtr<ImageDecoder> create(const SegmentReader& data, AlphaOption, GammaAndColorProfileOption);
virtual String filenameExtension() const = 0;
bool isAllDataReceived() const { return m_isAllDataReceived; }
- void setData(SharedBuffer* data, bool allDataReceived)
+ void setData(SegmentReader* data, bool allDataReceived)
Peter Kasting 2016/03/23 02:42:59 This takes ownership from the caller. It should e
f(malita) 2016/03/23 16:41:58 +1 Not new to this CL, but setData should take a
scroggo_chromium 2016/03/24 13:59:45 Since my CL did not introduce this pattern, do you
f(malita) 2016/03/24 16:48:37 Yeah, we should do that separately.
{
if (m_failed)
return;
@@ -114,7 +114,7 @@ public:
onSetData(data);
}
- virtual void onSetData(SharedBuffer* data) { }
+ virtual void onSetData(SegmentReader* data) { }
bool isSizeAvailable()
{
@@ -334,7 +334,7 @@ protected:
// Decodes the requested frame.
virtual void decode(size_t) = 0;
- RefPtr<SharedBuffer> m_data; // The encoded data.
+ RefPtr<SegmentReader> m_data; // The encoded data.
Vector<ImageFrame, 1> m_frameBufferCache;
bool m_premultiplyAlpha;
bool m_ignoreGammaAndColorProfile;

Powered by Google App Engine
This is Rietveld 408576698