Brian Salomon | 6422722 | 2020-02-26 13:28:42 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 Google LLC |
| 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 GrDeviceSpaceEffect.fp; do not modify. |
| 10 | **************************************************************************************************/ |
| 11 | #ifndef GrDeviceSpaceEffect_DEFINED |
| 12 | #define GrDeviceSpaceEffect_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" |
| 18 | class GrDeviceSpaceEffect : public GrFragmentProcessor { |
| 19 | public: |
Michael Ludwig | 4e221bd | 2020-06-05 11:29:36 -0400 | [diff] [blame^] | 20 | static std::unique_ptr<GrFragmentProcessor> Make(std::unique_ptr<GrFragmentProcessor> fp, |
| 21 | const SkMatrix& matrix = SkMatrix::I()) { |
| 22 | return std::unique_ptr<GrFragmentProcessor>(new GrDeviceSpaceEffect(std::move(fp), matrix)); |
Brian Salomon | 6422722 | 2020-02-26 13:28:42 -0500 | [diff] [blame] | 23 | } |
| 24 | GrDeviceSpaceEffect(const GrDeviceSpaceEffect& src); |
| 25 | std::unique_ptr<GrFragmentProcessor> clone() const override; |
| 26 | const char* name() const override { return "DeviceSpaceEffect"; } |
| 27 | int fp_index = -1; |
Michael Ludwig | 4e221bd | 2020-06-05 11:29:36 -0400 | [diff] [blame^] | 28 | SkMatrix matrix; |
Brian Salomon | 6422722 | 2020-02-26 13:28:42 -0500 | [diff] [blame] | 29 | |
| 30 | private: |
Michael Ludwig | 4e221bd | 2020-06-05 11:29:36 -0400 | [diff] [blame^] | 31 | GrDeviceSpaceEffect(std::unique_ptr<GrFragmentProcessor> fp, SkMatrix matrix) |
| 32 | : INHERITED(kGrDeviceSpaceEffect_ClassID, kNone_OptimizationFlags), matrix(matrix) { |
Brian Salomon | 6422722 | 2020-02-26 13:28:42 -0500 | [diff] [blame] | 33 | SkASSERT(fp); |
| 34 | fp_index = this->numChildProcessors(); |
Ethan Nicholas | 5843012 | 2020-04-14 09:54:02 -0400 | [diff] [blame] | 35 | fp->setSampledWithExplicitCoords(); |
Brian Salomon | 6422722 | 2020-02-26 13:28:42 -0500 | [diff] [blame] | 36 | this->registerChildProcessor(std::move(fp)); |
| 37 | } |
| 38 | GrGLSLFragmentProcessor* onCreateGLSLInstance() const override; |
| 39 | void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override; |
| 40 | bool onIsEqual(const GrFragmentProcessor&) const override; |
| 41 | GR_DECLARE_FRAGMENT_PROCESSOR_TEST |
| 42 | typedef GrFragmentProcessor INHERITED; |
| 43 | }; |
| 44 | #endif |