blob: 37174314b3365873c2ecf7faa1a8a9f3c31a4b8a [file] [log] [blame]
Brian Salomon64227222020-02-26 13:28:42 -05001/*
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"
18class GrDeviceSpaceEffect : public GrFragmentProcessor {
19public:
Michael Ludwig4e221bd2020-06-05 11:29:36 -040020 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 Salomon64227222020-02-26 13:28:42 -050023 }
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 Ludwig4e221bd2020-06-05 11:29:36 -040028 SkMatrix matrix;
Brian Salomon64227222020-02-26 13:28:42 -050029
30private:
Michael Ludwig4e221bd2020-06-05 11:29:36 -040031 GrDeviceSpaceEffect(std::unique_ptr<GrFragmentProcessor> fp, SkMatrix matrix)
32 : INHERITED(kGrDeviceSpaceEffect_ClassID, kNone_OptimizationFlags), matrix(matrix) {
Brian Salomon64227222020-02-26 13:28:42 -050033 SkASSERT(fp);
34 fp_index = this->numChildProcessors();
Ethan Nicholas58430122020-04-14 09:54:02 -040035 fp->setSampledWithExplicitCoords();
Brian Salomon64227222020-02-26 13:28:42 -050036 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