blob: fb3e24dd57e8b0fabd80e73951c88a6e8932cbde [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#include "GrDeviceSpaceEffect.h"
12
John Stiles45f5b032020-07-27 17:31:29 -040013#include "src/core/SkUtils.h"
Greg Daniel456f9b52020-03-05 19:14:18 +000014#include "src/gpu/GrTexture.h"
Brian Salomon64227222020-02-26 13:28:42 -050015#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
16#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
17#include "src/gpu/glsl/GrGLSLProgramBuilder.h"
18#include "src/sksl/SkSLCPP.h"
19#include "src/sksl/SkSLUtil.h"
20class GrGLSLDeviceSpaceEffect : public GrGLSLFragmentProcessor {
21public:
22 GrGLSLDeviceSpaceEffect() {}
23 void emitCode(EmitArgs& args) override {
24 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
25 const GrDeviceSpaceEffect& _outer = args.fFp.cast<GrDeviceSpaceEffect>();
26 (void)_outer;
Michael Ludwige2d67ce2020-06-26 10:11:43 -040027 SkString _coords203("sk_FragCoord.xy");
Brian Osman6b5dbb42020-07-15 15:31:05 -040028 SkString _sample203 = this->invokeChild(0, args, _coords203.c_str());
John Stiles50819422020-06-18 13:00:38 -040029 fragBuilder->codeAppendf(
Michael Ludwige2d67ce2020-06-26 10:11:43 -040030 R"SkSL(%s = %s;
John Stiles50819422020-06-18 13:00:38 -040031)SkSL",
Michael Ludwige2d67ce2020-06-26 10:11:43 -040032 args.fOutputColor, _sample203.c_str());
Brian Salomon64227222020-02-26 13:28:42 -050033 }
34
35private:
36 void onSetData(const GrGLSLProgramDataManager& pdman,
Michael Ludwige2d67ce2020-06-26 10:11:43 -040037 const GrFragmentProcessor& _proc) override {}
Brian Salomon64227222020-02-26 13:28:42 -050038};
39GrGLSLFragmentProcessor* GrDeviceSpaceEffect::onCreateGLSLInstance() const {
40 return new GrGLSLDeviceSpaceEffect();
41}
42void GrDeviceSpaceEffect::onGetGLSLProcessorKey(const GrShaderCaps& caps,
43 GrProcessorKeyBuilder* b) const {}
44bool GrDeviceSpaceEffect::onIsEqual(const GrFragmentProcessor& other) const {
45 const GrDeviceSpaceEffect& that = other.cast<GrDeviceSpaceEffect>();
46 (void)that;
47 return true;
48}
49GrDeviceSpaceEffect::GrDeviceSpaceEffect(const GrDeviceSpaceEffect& src)
Michael Ludwige2d67ce2020-06-26 10:11:43 -040050 : INHERITED(kGrDeviceSpaceEffect_ClassID, src.optimizationFlags()) {
Brian Osman12c5d292020-07-13 16:11:35 -040051 this->cloneAndRegisterAllChildProcessors(src);
Brian Salomon64227222020-02-26 13:28:42 -050052}
53std::unique_ptr<GrFragmentProcessor> GrDeviceSpaceEffect::clone() const {
John Stilesfbd050b2020-08-03 13:21:46 -040054 return std::make_unique<GrDeviceSpaceEffect>(*this);
Brian Salomon64227222020-02-26 13:28:42 -050055}
56GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDeviceSpaceEffect);
57#if GR_TEST_UTILS
58std::unique_ptr<GrFragmentProcessor> GrDeviceSpaceEffect::TestCreate(GrProcessorTestData* d) {
Brian Osman609f1592020-07-01 15:14:39 -040059 return GrDeviceSpaceEffect::Make(GrProcessorUnitTest::MakeChildFP(d));
Brian Salomon64227222020-02-26 13:28:42 -050060}
61#endif