1/*
2 * Copyright 2018 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/**************************************************************************************************
9 *** This file was autogenerated from GrMagnifierEffect.fp; do not modify.
10 **************************************************************************************************/
11#ifndef GrMagnifierEffect_DEFINED
12#define GrMagnifierEffect_DEFINED
13#include "include/core/SkTypes.h"
14#include "include/core/SkM44.h"
15
16#include "src/gpu/GrCoordTransform.h"
17#include "src/gpu/GrFragmentProcessor.h"
18class GrMagnifierEffect : public GrFragmentProcessor {
19public:
20 static std::unique_ptr<GrFragmentProcessor> Make(GrSurfaceProxyView src,
21 SkIRect bounds,
22 SkRect srcRect,
23 float xInvZoom,
24 float yInvZoom,
25 float xInvInset,
26 float yInvInset) {
27 return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect(
28 std::move(src), bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset));
29 }
30 GrMagnifierEffect(const GrMagnifierEffect& src);
31 std::unique_ptr<GrFragmentProcessor> clone() const override;
32 const char* name() const override { return "MagnifierEffect"; }
33 GrCoordTransform srcCoordTransform;
34 TextureSampler src;
35 SkIRect bounds;
36 SkRect srcRect;
37 float xInvZoom;
38 float yInvZoom;
39 float xInvInset;
40 float yInvInset;
41
42private:
43 GrMagnifierEffect(GrSurfaceProxyView src,
44 SkIRect bounds,
45 SkRect srcRect,
46 float xInvZoom,
47 float yInvZoom,
48 float xInvInset,
49 float yInvInset)
50 : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags)
51 , srcCoordTransform(SkMatrix::I(), src.proxy(), src.origin())
52 , src(std::move(src))
53 , bounds(bounds)
54 , srcRect(srcRect)
55 , xInvZoom(xInvZoom)
56 , yInvZoom(yInvZoom)
57 , xInvInset(xInvInset)
58 , yInvInset(yInvInset) {
59 this->setTextureSamplerCnt(1);
60 this->addCoordTransform(&srcCoordTransform);
61 }
62 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
63 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
64 bool onIsEqual(const GrFragmentProcessor&) const override;
65 const TextureSampler& onTextureSampler(int) const override;
66 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
67 typedef GrFragmentProcessor INHERITED;
68};
69#endif
70