1/*
2 * Copyright 2018 Google Inc.
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 GrPremulInputFragmentProcessor.fp; do not modify.
10 **************************************************************************************************/
11#include "GrPremulInputFragmentProcessor.h"
12
13#include "src/gpu/GrTexture.h"
14#include "src/gpu/glsl/GrGLSLFragmentProcessor.h"
15#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
16#include "src/gpu/glsl/GrGLSLProgramBuilder.h"
17#include "src/sksl/SkSLCPP.h"
18#include "src/sksl/SkSLUtil.h"
19class GrGLSLPremulInputFragmentProcessor : public GrGLSLFragmentProcessor {
20public:
21 GrGLSLPremulInputFragmentProcessor() {}
22 void emitCode(EmitArgs& args) override {
23 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
24 const GrPremulInputFragmentProcessor& _outer =
25 args.fFp.cast<GrPremulInputFragmentProcessor>();
26 (void)_outer;
27 fragBuilder->codeAppendf("%s = %s;\n%s.xyz *= %s.w;\n", args.fOutputColor, args.fInputColor,
28 args.fOutputColor, args.fInputColor);
29 }
30
31private:
32 void onSetData(const GrGLSLProgramDataManager& pdman,
33 const GrFragmentProcessor& _proc) override {}
34};
35GrGLSLFragmentProcessor* GrPremulInputFragmentProcessor::onCreateGLSLInstance() const {
36 return new GrGLSLPremulInputFragmentProcessor();
37}
38void GrPremulInputFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
39 GrProcessorKeyBuilder* b) const {}
40bool GrPremulInputFragmentProcessor::onIsEqual(const GrFragmentProcessor& other) const {
41 const GrPremulInputFragmentProcessor& that = other.cast<GrPremulInputFragmentProcessor>();
42 (void)that;
43 return true;
44}
45GrPremulInputFragmentProcessor::GrPremulInputFragmentProcessor(
46 const GrPremulInputFragmentProcessor& src)
47 : INHERITED(kGrPremulInputFragmentProcessor_ClassID, src.optimizationFlags()) {}
48std::unique_ptr<GrFragmentProcessor> GrPremulInputFragmentProcessor::clone() const {
49 return std::unique_ptr<GrFragmentProcessor>(new GrPremulInputFragmentProcessor(*this));
50}
51