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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/SegmentStream.h

Issue 2565323003: Move gif image decoder to SkCodec (Closed)
Patch Set: Replace SegmentStream::SetPositionState() Created 3 years, 4 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 (c) 2017 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 SegmentStream_h
6 #define SegmentStream_h
7
8 #include <algorithm>
9 #include "platform/PlatformExport.h"
10 #include "platform/wtf/RefPtr.h"
11 #include "third_party/skia/include/core/SkStream.h"
12
13 namespace blink {
14
15 class SegmentReader;
16
17 class PLATFORM_EXPORT SegmentStream : public SkStream {
18 public:
19 SegmentStream();
20 SegmentStream(SegmentStream&& rhs);
21 ~SegmentStream() override;
22
23 SegmentStream& operator=(SegmentStream&& rhs);
24
25 void SetReader(WTF::RefPtr<SegmentReader>);
26 // If a buffer has shrunk beyond the point we have read, it has been cleared.
27 // This allows clients to be aware of when data suddenly disappears.
28 bool IsCleared() const;
29
30 // From SkStream:
31 size_t read(void* buffer, size_t) override;
32 size_t peek(void* buffer, size_t) const override;
33 bool isAtEnd() const override;
34 bool rewind() override;
35 bool hasPosition() const override { return true; }
36 size_t getPosition() const override { return position_; }
37 bool seek(size_t position) override;
38 bool move(long offset) override;
39 bool hasLength() const override { return true; }
40 size_t getLength() const override;
41
42 private:
43 WTF::RefPtr<SegmentReader> reader_;
44 size_t position_ = 0;
45 };
46
47 } // namespace blink
48
49 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698