aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkSingleInputImageFilter.h
blob: e7819c4f2f147471a07d62592acfbed076b97329 (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
38
39
40
41
42
43
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSingleInputImageFilter_DEFINED
#define SkSingleInputImageFilter_DEFINED

#include "SkImageFilter.h"

class SkMatrix;
struct SkIPoint;
class GrTexture;

class SK_API SkSingleInputImageFilter : public SkImageFilter {
public:
    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSingleInputImageFilter)

protected:
    explicit SkSingleInputImageFilter(SkImageFilter* input);
    ~SkSingleInputImageFilter();
    explicit SkSingleInputImageFilter(SkFlattenableReadBuffer& rb);
    virtual void flatten(SkFlattenableWriteBuffer& wb) const SK_OVERRIDE;

    // Recurses on input (if non-NULL), and returns the processed result,
    // otherwise returns src.
    SkBitmap getInputResult(Proxy*, const SkBitmap& src, const SkMatrix&,
                            SkIPoint* offset);

#if SK_SUPPORT_GPU
    // Recurses on input (if non-NULL), and returns the processed result as
    // a texture, otherwise returns src.
    GrTexture* getInputResultAsTexture(Proxy* proxy, GrTexture* src, const SkRect& rect);
#endif

    SkImageFilter* input() const { return getInput(0); }
private:
    typedef SkImageFilter INHERITED;
};

#endif