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