blob: 441527d815b2f55d6b73483d75dcb78bd8f73367 [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
John Stiles88183902020-06-10 16:40:38 -040013
Mike Reed46f5c5f2020-02-20 15:42:29 -050014#include "include/core/SkM44.h"
John Stiles88183902020-06-10 16:40:38 -040015#include "include/core/SkTypes.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050016
Mike Kleinc0bd9f92019-04-23 12:05:21 -050017#include "src/gpu/GrFragmentProcessor.h"
John Stiles88183902020-06-10 16:40:38 -040018
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050019class GrMagnifierEffect : public GrFragmentProcessor {
20public:
Brian Salomonf5cd6042020-06-16 14:04:25 -040021 static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> src,
Brian Osmanff0717f2020-03-27 11:08:38 -040022 SkIRect bounds,
23 SkRect srcRect,
24 float xInvZoom,
25 float yInvZoom,
26 float xInvInset,
27 float yInvInset) {
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050028 return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect(
Greg Daniel43956122020-02-11 15:49:27 -050029 std::move(src), bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset));
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050030 }
31 GrMagnifierEffect(const GrMagnifierEffect& src);
John Stilesa1df23c2020-08-11 17:19:55 -040032#ifdef SK_DEBUG
33 SkString dumpInfo() const override;
34#endif
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050035 std::unique_ptr<GrFragmentProcessor> clone() const override;
Mike Kleind6ab77a2019-03-21 08:18:24 -050036 const char* name() const override { return "MagnifierEffect"; }
Ethan Nicholasbcd51e82019-04-09 10:40:41 -040037 SkIRect bounds;
38 SkRect srcRect;
39 float xInvZoom;
40 float yInvZoom;
41 float xInvInset;
42 float yInvInset;
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050043
44private:
Brian Salomonf5cd6042020-06-16 14:04:25 -040045 GrMagnifierEffect(std::unique_ptr<GrFragmentProcessor> src,
Brian Osmanff0717f2020-03-27 11:08:38 -040046 SkIRect bounds,
47 SkRect srcRect,
48 float xInvZoom,
49 float yInvZoom,
50 float xInvInset,
51 float yInvInset)
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050052 : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags)
Ethan Nicholasbcd51e82019-04-09 10:40:41 -040053 , bounds(bounds)
54 , srcRect(srcRect)
55 , xInvZoom(xInvZoom)
56 , yInvZoom(yInvZoom)
57 , xInvInset(xInvInset)
58 , yInvInset(yInvInset) {
Michael Ludwige88320b2020-06-24 09:04:56 -040059 this->setUsesSampleCoordsDirectly();
Brian Salomonf5cd6042020-06-16 14:04:25 -040060 SkASSERT(src);
Brian Osman12c5d292020-07-13 16:11:35 -040061 this->registerChild(std::move(src), SkSL::SampleUsage::Explicit());
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050062 }
63 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
64 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
65 bool onIsEqual(const GrFragmentProcessor&) const override;
66 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
Ethan Nicholas2d5f9b32017-12-13 14:36:14 -050067 typedef GrFragmentProcessor INHERITED;
68};
69#endif