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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/SegmentReader.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SegmentReader_h
6 #define SegmentReader_h
7
8 #include "third_party/skia/include/core/SkData.h"
9 #include "wtf/Noncopyable.h"
10 #include "wtf/PassRefPtr.h"
11 #include "wtf/RefCounted.h"
12
13 namespace blink {
14
15 // Interface that looks like SharedBuffer. Used by ImageDecoders to use various
16 // sources of input including:
17 // - SharedBuffer
18 // - for when the caller already has a SharedBuffer
19 // - SkData
20 // - for when the caller already has an SkData
21 // - SkROBuffer
22 // - for when the caller wants to read/write in different threads
23 //
24 // Unlike SharedBuffer, this is a read-only interface. There is no way to
25 // modify the underlying data source.
26 class SegmentReader : public RefCounted<SegmentReader> {
27 WTF_MAKE_NONCOPYABLE(SegmentReader);
28 public:
29 SegmentReader() {}
30 virtual ~SegmentReader() {}
31 virtual size_t size() const = 0;
32 virtual size_t getSomeData(const char*& data, size_t position) const = 0;
Peter Kasting 2016/03/23 02:42:59 Maybe for clarity at the callers this should take
scroggo_chromium 2016/03/24 13:59:46 I'm not opposed to that in theory, but a goal is t
Peter Kasting 2016/03/24 22:05:43 Yeah, that seems sane. Up to you whether you thin
scroggo_chromium 2016/03/25 01:05:10 Acknowledged.
33 virtual PassRefPtr<SkData> getAsSkData() const = 0;
34 };
35
36 } // namespace blink
37 #endif // SegmentReader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698