Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 1 | /* |
Ethan Nicholas | 130fb3f | 2018-02-01 12:14:34 -0500 | [diff] [blame] | 2 | * Copyright 2018 Google Inc. |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 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 | |
Ethan Nicholas | 130fb3f | 2018-02-01 12:14:34 -0500 | [diff] [blame] | 8 | /************************************************************************************************** |
| 9 | *** This file was autogenerated from GrMagnifierEffect.fp; do not modify. |
| 10 | **************************************************************************************************/ |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 11 | #ifndef GrMagnifierEffect_DEFINED |
| 12 | #define GrMagnifierEffect_DEFINED |
John Stiles | 8818390 | 2020-06-10 16:40:38 -0400 | [diff] [blame] | 13 | |
Mike Reed | 46f5c5f | 2020-02-20 15:42:29 -0500 | [diff] [blame] | 14 | #include "include/core/SkM44.h" |
John Stiles | 8818390 | 2020-06-10 16:40:38 -0400 | [diff] [blame] | 15 | #include "include/core/SkTypes.h" |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 16 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 17 | #include "src/gpu/GrFragmentProcessor.h" |
John Stiles | 8818390 | 2020-06-10 16:40:38 -0400 | [diff] [blame] | 18 | |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 19 | class GrMagnifierEffect : public GrFragmentProcessor { |
| 20 | public: |
Brian Salomon | f5cd604 | 2020-06-16 14:04:25 -0400 | [diff] [blame] | 21 | static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> src, |
Brian Osman | ff0717f | 2020-03-27 11:08:38 -0400 | [diff] [blame] | 22 | SkIRect bounds, |
| 23 | SkRect srcRect, |
| 24 | float xInvZoom, |
| 25 | float yInvZoom, |
| 26 | float xInvInset, |
| 27 | float yInvInset) { |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 28 | return std::unique_ptr<GrFragmentProcessor>(new GrMagnifierEffect( |
Greg Daniel | 4395612 | 2020-02-11 15:49:27 -0500 | [diff] [blame] | 29 | std::move(src), bounds, srcRect, xInvZoom, yInvZoom, xInvInset, yInvInset)); |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 30 | } |
| 31 | GrMagnifierEffect(const GrMagnifierEffect& src); |
John Stiles | a1df23c | 2020-08-11 17:19:55 -0400 | [diff] [blame^] | 32 | #ifdef SK_DEBUG |
| 33 | SkString dumpInfo() const override; |
| 34 | #endif |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 35 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
Mike Klein | d6ab77a | 2019-03-21 08:18:24 -0500 | [diff] [blame] | 36 | const char* name() const override { return "MagnifierEffect"; } |
Ethan Nicholas | bcd51e8 | 2019-04-09 10:40:41 -0400 | [diff] [blame] | 37 | SkIRect bounds; |
| 38 | SkRect srcRect; |
| 39 | float xInvZoom; |
| 40 | float yInvZoom; |
| 41 | float xInvInset; |
| 42 | float yInvInset; |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 43 | |
| 44 | private: |
Brian Salomon | f5cd604 | 2020-06-16 14:04:25 -0400 | [diff] [blame] | 45 | GrMagnifierEffect(std::unique_ptr<GrFragmentProcessor> src, |
Brian Osman | ff0717f | 2020-03-27 11:08:38 -0400 | [diff] [blame] | 46 | SkIRect bounds, |
| 47 | SkRect srcRect, |
| 48 | float xInvZoom, |
| 49 | float yInvZoom, |
| 50 | float xInvInset, |
| 51 | float yInvInset) |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 52 | : INHERITED(kGrMagnifierEffect_ClassID, kNone_OptimizationFlags) |
Ethan Nicholas | bcd51e8 | 2019-04-09 10:40:41 -0400 | [diff] [blame] | 53 | , bounds(bounds) |
| 54 | , srcRect(srcRect) |
| 55 | , xInvZoom(xInvZoom) |
| 56 | , yInvZoom(yInvZoom) |
| 57 | , xInvInset(xInvInset) |
| 58 | , yInvInset(yInvInset) { |
Michael Ludwig | e88320b | 2020-06-24 09:04:56 -0400 | [diff] [blame] | 59 | this->setUsesSampleCoordsDirectly(); |
Brian Salomon | f5cd604 | 2020-06-16 14:04:25 -0400 | [diff] [blame] | 60 | SkASSERT(src); |
Brian Osman | 12c5d29 | 2020-07-13 16:11:35 -0400 | [diff] [blame] | 61 | this->registerChild(std::move(src), SkSL::SampleUsage::Explicit()); |
Ethan Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 62 | } |
| 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 Nicholas | 2d5f9b3 | 2017-12-13 14:36:14 -0500 | [diff] [blame] | 67 | typedef GrFragmentProcessor INHERITED; |
| 68 | }; |
| 69 | #endif |