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

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

Issue 2565323003: Move gif image decoder to SkCodec (Closed)
Patch Set: Setting has alpha on a partial decode. Created 3 years, 8 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/image-decoders/SegmentReader.h"
10 #include "third_party/skia/include/core/SkStream.h"
11 #include "wtf/RefPtr.h"
12
13 namespace blink {
14
15 class PLATFORM_EXPORT SegmentStream : public SkStream {
16 public:
17 SegmentStream();
18 virtual ~SegmentStream() {}
19
20 void SetReader(SegmentReader*, bool all_contents_received);
21 bool IsCleared() const { return is_cleared_; }
22
23 // From SkStream:
24 size_t read(void* buffer, size_t) override;
25 size_t peek(void* buffer, size_t) const override;
26 bool isAtEnd() const override { return has_read_all_contents_; }
27 bool rewind() override;
28 bool hasPosition() const override { return true; }
29 size_t getPosition() const override { return position_; }
30 bool seek(size_t position) override;
31 bool move(long offset) override;
32 bool hasLength() const override { return true; }
33 size_t getLength() const override {
34 if (reader_)
35 return reader_->size();
36
37 return 0;
38 }
39
40 private:
41 WTF::RefPtr<SegmentReader> reader_;
42 size_t position_;
43 bool has_read_all_contents_;
44 bool is_cleared_;
45 };
46
47 } // namespace blink
48
49 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698