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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/SharedBufferSegmentReader.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/SharedBufferSegmentReader.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/SharedBufferSegmentReader.cpp b/third_party/WebKit/Source/platform/image-decoders/SharedBufferSegmentReader.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..057693e2db7be04daad42073e31830f36ad75873
--- /dev/null
+++ b/third_party/WebKit/Source/platform/image-decoders/SharedBufferSegmentReader.cpp
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "SharedBufferSegmentReader.h"
+
+namespace blink {
+
+SharedBufferSegmentReader::SharedBufferSegmentReader(PassRefPtr<SharedBuffer> buffer)
+: m_sharedBuffer(buffer) {}
+
+size_t SharedBufferSegmentReader::size() const
+{
+ return m_sharedBuffer->size();
+}
+
+size_t SharedBufferSegmentReader::getSomeData(const char*& data, size_t position) const
+{
+ return m_sharedBuffer->getSomeData(data, position);
+}
+
+PassRefPtr<SkData> SharedBufferSegmentReader::getAsSkData() const
+{
+ return m_sharedBuffer->getAsSkData();
+}
+
+} // namespace blink
+

Powered by Google App Engine
This is Rietveld 408576698