blob: cb0d00524b55e05e7cd57b6488ceb1c4098c76bf [file] [log] [blame]
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -05001/*
Ethan Nicholas130fb3f2018-02-01 12:14:34 -05002 * Copyright 2018 Google Inc.
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -05003 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
Ethan Nicholas130fb3f2018-02-01 12:14:34 -05008/**************************************************************************************************
9 *** This file was autogenerated from GrMagnifierEffect.fp; do not modify.
10 **************************************************************************************************/
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050011#ifndef GrMagnifierEffect_DEFINED
12#define GrMagnifierEffect_DEFINED
Mike Kleinc0bd9f92019-04-23 12:05:21 -050013#include "include/core/SkTypes.h"
14
15#include "src/gpu/GrCoordTransform.h"
16#include "src/gpu/GrFragmentProcessor.h"
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050017class GrMagnifierEffect : public GrFragmentProcessor {
18public:
Mike Kleind6ab77a2019-03-21 08:18:24 -050019 static std::unique_ptr<GrFragmentProcessor> Make(sk_sp<GrTextureProxy> src, SkIRect bounds,
20 SkRect srcRect, float xInvZoom, float yInvZoom,
21 float xInvInset, float yInvInset) {
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050022 return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect(
23 src, bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset));
24 }
25 GrMagnifierEffect(const GrMagnifierEffect& src);
26 std::unique_ptr<GrFragmentProcessor> clone() const override;
Mike Kleind6ab77a2019-03-21 08:18:24 -050027 const char* name() const override { return "MagnifierEffect"; }
Ethan Nicholasbcd51e82019-04-09 10:40:41 -040028 GrCoordTransform srcCoordTransform;
29 TextureSampler src;
30 SkIRect bounds;
31 SkRect srcRect;
32 float xInvZoom;
33 float yInvZoom;
34 float xInvInset;
35 float yInvInset;
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050036
37private:
Mike Kleind6ab77a2019-03-21 08:18:24 -050038 GrMagnifierEffect(sk_sp<GrTextureProxy> src, SkIRect bounds, SkRect srcRect, float xInvZoom,
39 float yInvZoom, float xInvInset, float yInvInset)
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050040 : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags)
Ethan Nicholasbcd51e82019-04-09 10:40:41 -040041 , srcCoordTransform(SkMatrix::I(), src.get())
42 , src(std::move(src))
43 , bounds(bounds)
44 , srcRect(srcRect)
45 , xInvZoom(xInvZoom)
46 , yInvZoom(yInvZoom)
47 , xInvInset(xInvInset)
48 , yInvInset(yInvInset) {
Brian Salomonf7dcd762018-07-30 14:48:15 -040049 this->setTextureSamplerCnt(1);
Ethan Nicholasbcd51e82019-04-09 10:40:41 -040050 this->addCoordTransform(&srcCoordTransform);
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050051 }
52 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
53 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
54 bool onIsEqual(const GrFragmentProcessor&) const override;
Brian Salomonf7dcd762018-07-30 14:48:15 -040055 const TextureSampler& onTextureSampler(int) const override;
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050056 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050057 typedef GrFragmentProcessor INHERITED;
58};
59#endif