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"
13 #include "SkEncodedFormat.h"
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 
~SkRawAdapterCodec()27     virtual ~SkRawAdapterCodec() {}
28 
29 protected:
30 
31     SkISize onGetSampledDimensions(int sampleSize) const override;
32 
onGetSupportedSubset(SkIRect *)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
43