Home | History | Annotate | Download | only in codec
      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 SkWebpAdapterCodec_DEFINED
      8 #define SkWebpAdapterCodec_DEFINED
      9 
     10 #include "SkAndroidCodec.h"
     11 #include "SkWebpCodec.h"
     12 
     13 /**
     14  *  This class implements the functionality of SkAndroidCodec.  It uses an
     15  *  SkWebpCodec.
     16  */
     17 class SkWebpAdapterCodec : public SkAndroidCodec {
     18 public:
     19 
     20     explicit SkWebpAdapterCodec(SkWebpCodec*, ExifOrientationBehavior);
     21 
     22     ~SkWebpAdapterCodec() 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     typedef SkAndroidCodec INHERITED;
     36 };
     37 #endif // SkWebpAdapterCodec_DEFINED
     38