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

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

Issue 1866243003: Revert of Eliminate copies of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2b876f49e77075bcc7565d1f3c350505b1ea19d4..21cc9616ae5159c5e1f62bbe3c868348cf5a06d0 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -33,7 +33,6 @@
#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"
@@ -123,29 +122,22 @@
// 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 char* data, size_t length, AlphaOption, GammaAndColorProfileOption);
- static PassOwnPtr<ImageDecoder> create(const SharedBuffer&, AlphaOption, GammaAndColorProfileOption);
- static PassOwnPtr<ImageDecoder> create(const SegmentReader&, AlphaOption, GammaAndColorProfileOption);
+ static PassOwnPtr<ImageDecoder> create(const SharedBuffer& data, AlphaOption, GammaAndColorProfileOption);
virtual String filenameExtension() const = 0;
bool isAllDataReceived() const { return m_isAllDataReceived; }
- void setData(PassRefPtr<SegmentReader> data, bool allDataReceived)
+ void setData(SharedBuffer* data, bool allDataReceived)
{
if (m_failed)
return;
m_data = data;
m_isAllDataReceived = allDataReceived;
- onSetData(m_data.get());
- }
-
- void setData(PassRefPtr<SharedBuffer> data, bool allDataReceived)
- {
- setData(SegmentReader::createFromSharedBuffer(data), allDataReceived);
- }
-
- virtual void onSetData(SegmentReader* data) { }
+ onSetData(data);
+ }
+
+ virtual void onSetData(SharedBuffer* data) { }
bool isSizeAvailable()
{
@@ -318,7 +310,7 @@
// Decodes the requested frame.
virtual void decode(size_t) = 0;
- RefPtr<SegmentReader> m_data; // The encoded data.
+ RefPtr<SharedBuffer> 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