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

Unified Diff: third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h

Issue 2918443003: Remove redundant reading and writing of data about SharedBuffer.
Patch Set: benchmark Created 3 years, 6 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/DecodingImageGenerator.h
diff --git a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h
index aa9722d99854d22529cda2ca720a64f1c7681ab0..0b5633758ef981cbc59e1c791e12882e2a41a969 100644
--- a/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h
+++ b/third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h
@@ -27,6 +27,7 @@
#define DecodingImageGenerator_h
#include "platform/PlatformExport.h"
+#include "platform/SharedBuffer.h"
#include "platform/image-decoders/SegmentReader.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/Noncopyable.h"
@@ -60,6 +61,14 @@ class PLATFORM_EXPORT DecodingImageGenerator final : public SkImageGenerator {
bool all_data_received,
size_t index,
uint32_t unique_id = kNeedNewImageUniqueID);
+
+ DecodingImageGenerator(PassRefPtr<ImageFrameGenerator>,
+ const SkImageInfo&,
+ PassRefPtr<SharedBuffer::ThreadSafeStepper>,
+ bool all_data_received,
+ size_t index,
+ uint32_t unique_id = kNeedNewImageUniqueID);
+
~DecodingImageGenerator() override;
void SetCanYUVDecode(bool yes) { can_yuv_decode_ = yes; }
@@ -77,8 +86,11 @@ class PLATFORM_EXPORT DecodingImageGenerator final : public SkImageGenerator {
bool onGetYUV8Planes(const SkYUVSizeInfo&, void* planes[3]) override;
private:
+ PassRefPtr<SegmentReader> encoded_data() const;
+
RefPtr<ImageFrameGenerator> frame_generator_;
- const RefPtr<SegmentReader> data_; // Data source.
+ const RefPtr<SegmentReader> reader_;
+ const RefPtr<SharedBuffer::ThreadSafeStepper> stepper_;
const bool all_data_received_;
const size_t frame_index_;
bool can_yuv_decode_;

Powered by Google App Engine
This is Rietveld 408576698