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 "SkEncodedImageFormat.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 explicit SkRawAdapterCodec(SkRawCodec*, ExifOrientationBehavior); 25 26 ~SkRawAdapterCodec() override {} 27 28 protected: 29 30 SkISize onGetSampledDimensions(int sampleSize) const override; 31 32 bool onGetSupportedSubset(SkIRect* /*desiredSubset*/) const override { return false; } 33 34 SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, 35 const AndroidOptions& options) override; 36 37 private: 38 39 typedef SkAndroidCodec INHERITED; 40 }; 41 #endif // SkRawAdapterCodec_DEFINED 42