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

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

Issue 2565323003: Move gif image decoder to SkCodec (Closed)
Patch Set: Explicitly specify move ctor / assignment until required patch lands. 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(const SegmentStream&) = delete;
21 SegmentStream& operator=(const SegmentStream&) = delete;
22 SegmentStream(SegmentStream&&);
23 SegmentStream& operator=(SegmentStream&&);
24
25 ~SegmentStream() override;
26
27 void SetReader(WTF::RefPtr<SegmentReader>);
28 // If a buffer has shrunk beyond the point we have read, it has been cleared.
29 // This allows clients to be aware of when data suddenly disappears.
30 bool IsCleared() const;
31
32 // From SkStream:
33 size_t read(void* buffer, size_t) override;
34 size_t peek(void* buffer, size_t) const override;
35 bool isAtEnd() const override;
36 bool rewind() override;
37 bool hasPosition() const override { return true; }
38 size_t getPosition() const override { return position_; }
39 bool seek(size_t position) override;
40 bool move(long offset) override;
41 bool hasLength() const override { return true; }
42 size_t getLength() const override;
43
44 private:
45 WTF::RefPtr<SegmentReader> reader_;
46 size_t position_ = 0;
47 };
48
49 } // namespace blink
50
51 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698