yujieqin | 916de9f | 2016-01-25 08:26:16 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 | |
| 8 | #ifndef SkRawAdapterCodec_DEFINED |
| 9 | #define SkRawAdapterCodec_DEFINED |
| 10 | |
| 11 | #include "SkAndroidCodec.h" |
| 12 | #include "SkCodec.h" |
Hal Canary | db68301 | 2016-11-23 08:55:18 -0700 | [diff] [blame] | 13 | #include "SkEncodedImageFormat.h" |
yujieqin | 916de9f | 2016-01-25 08:26:16 -0800 | [diff] [blame] | 14 | #include "SkRawCodec.h" |
| 15 | #include "SkStream.h" |
| 16 | #include "SkTypes.h" |
| 17 | |
| 18 | /** |
| 19 | * This class implements the functionality of SkAndroidCodec. It uses an |
| 20 | * SkRawCodec. |
| 21 | */ |
| 22 | class SkRawAdapterCodec : public SkAndroidCodec { |
| 23 | public: |
| 24 | |
| 25 | explicit SkRawAdapterCodec(SkRawCodec*); |
| 26 | |
Brian Salomon | d3b6597 | 2017-03-22 12:05:03 -0400 | [diff] [blame^] | 27 | ~SkRawAdapterCodec() override {} |
yujieqin | 916de9f | 2016-01-25 08:26:16 -0800 | [diff] [blame] | 28 | |
| 29 | protected: |
| 30 | |
| 31 | SkISize onGetSampledDimensions(int sampleSize) const override; |
| 32 | |
| 33 | bool onGetSupportedSubset(SkIRect* /*desiredSubset*/) const override { return false; } |
| 34 | |
| 35 | SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
| 36 | const AndroidOptions& options) override; |
| 37 | |
| 38 | private: |
| 39 | |
| 40 | typedef SkAndroidCodec INHERITED; |
| 41 | }; |
| 42 | #endif // SkRawAdapterCodec_DEFINED |