aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkWebpAdapterCodec.h
blob: fc8328cf56f5c1d7f0b9705d527e01edcd7bc864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#ifndef SkWebpAdapterCodec_DEFINED
#define SkWebpAdapterCodec_DEFINED

#include "SkAndroidCodec.h"
#include "SkWebpCodec.h"

/**
 *  This class implements the functionality of SkAndroidCodec.  It uses an
 *  SkWebpCodec.
 */
class SkWebpAdapterCodec : public SkAndroidCodec {
public:

    explicit SkWebpAdapterCodec(SkWebpCodec*, ExifOrientationBehavior);

    ~SkWebpAdapterCodec() override {}

protected:

    SkISize onGetSampledDimensions(int sampleSize) const override;

    bool onGetSupportedSubset(SkIRect* desiredSubset) const override;

    SkCodec::Result onGetAndroidPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
            const AndroidOptions& options) override;

private:

    typedef SkAndroidCodec INHERITED;
};
#endif // SkWebpAdapterCodec_DEFINED