/src/skia/src/codec/SkAndroidCodecAdapter.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2015 Google Inc. |
3 | | * |
4 | | * Use of this source code is governed by a BSD-style license that can be |
5 | | * found in the LICENSE file. |
6 | | */ |
7 | | #ifndef SkAndroidCodecAdapter_DEFINED |
8 | | #define SkAndroidCodecAdapter_DEFINED |
9 | | |
10 | | #include "include/codec/SkAndroidCodec.h" |
11 | | |
12 | | /** |
13 | | * This class wraps SkCodec to implement the functionality of SkAndroidCodec. |
14 | | * The underlying SkCodec implements sampled decodes. SkCodec's that do not |
15 | | * implement that are wrapped with SkSampledCodec instead. |
16 | | */ |
17 | | class SkAndroidCodecAdapter : public SkAndroidCodec { |
18 | | public: |
19 | | |
20 | | explicit SkAndroidCodecAdapter(SkCodec*); |
21 | | |
22 | 0 | ~SkAndroidCodecAdapter() override {} |
23 | | |
24 | | protected: |
25 | | |
26 | | SkISize onGetSampledDimensions(int sampleSize) const override; |
27 | | |
28 | | bool onGetSupportedSubset(SkIRect* desiredSubset) const override; |
29 | | |
30 | | SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
31 | | const AndroidOptions& options) override; |
32 | | |
33 | | private: |
34 | | |
35 | | using INHERITED = SkAndroidCodec; |
36 | | }; |
37 | | #endif // SkAndroidCodecAdapter_DEFINED |