aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrMagnifierEffect.h
blob: 4100095d9eec6c1119aef15ba7a81341031cd9d1 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/**************************************************************************************************
 *** This file was autogenerated from GrMagnifierEffect.fp; do not modify.
 **************************************************************************************************/
#ifndef GrMagnifierEffect_DEFINED
#define GrMagnifierEffect_DEFINED
#include "SkTypes.h"
#if SK_SUPPORT_GPU
#include "GrFragmentProcessor.h"
#include "GrCoordTransform.h"
class GrMagnifierEffect : public GrFragmentProcessor {
public:
    SkIRect bounds() const { return fBounds; }
    SkRect srcRect() const { return fSrcRect; }
    float xInvZoom() const { return fXInvZoom; }
    float yInvZoom() const { return fYInvZoom; }
    float xInvInset() const { return fXInvInset; }
    float yInvInset() const { return fYInvInset; }
    static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> src, SkIRect bounds,
                                                     SkRect srcRect, float xInvZoom, float yInvZoom,
                                                     float xInvInset, float yInvInset) {
        return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect(
                src, bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset));
    }
    GrMagnifierEffect(const GrMagnifierEffect& src);
    std::unique_ptr<GrFragmentProcessor> clone() const override;
    const char* name() const override { return "MagnifierEffect"; }

private:
    GrMagnifierEffect(sk_sp<GrTextureProxy> src, SkIRect bounds, SkRect srcRect, float xInvZoom,
                      float yInvZoom, float xInvInset, float yInvInset)
            : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags)
            , fSrc(std::move(src))
            , fBounds(bounds)
            , fSrcRect(srcRect)
            , fXInvZoom(xInvZoom)
            , fYInvZoom(yInvZoom)
            , fXInvInset(xInvInset)
            , fYInvInset(yInvInset)
            , fSrcCoordTransform(SkMatrix::I(), fSrc.proxy()) {
        this->addTextureSampler(&fSrc);
        this->addCoordTransform(&fSrcCoordTransform);
    }
    GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
    void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
    bool onIsEqual(const GrFragmentProcessor&) const override;
    GR_DECLARE_FRAGMENT_PROCESSOR_TEST
    TextureSampler fSrc;
    SkIRect fBounds;
    SkRect fSrcRect;
    float fXInvZoom;
    float fYInvZoom;
    float fXInvInset;
    float fYInvInset;
    GrCoordTransform fSrcCoordTransform;
    typedef GrFragmentProcessor INHERITED;
};
#endif
#endif