Home | History | Annotate | Download | only in effects
      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:
     20     GrGLSLPremulInputFragmentProcessor() {}
     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:
     31     void onSetData(const GrGLSLProgramDataManager& pdman,
     32                    const GrFragmentProcessor& _proc) override {}
     33 };
     34 GrGLSLFragmentProcessor* GrPremulInputFragmentProcessor::onCreateGLSLInstance() const {
     35     return new GrGLSLPremulInputFragmentProcessor();
     36 }
     37 void GrPremulInputFragmentProcessor::onGetGLSLProcessorKey(const GrShaderCaps& caps,
     38                                                            GrProcessorKeyBuilder* b) const {}
     39 bool GrPremulInputFragmentProcessor::onIsEqual(const GrFragmentProcessor& other) const {
     40     const GrPremulInputFragmentProcessor& that = other.cast<GrPremulInputFragmentProcessor>();
     41     (void)that;
     42     return true;
     43 }
     44 GrPremulInputFragmentProcessor::GrPremulInputFragmentProcessor(
     45         const GrPremulInputFragmentProcessor& src)
     46         : INHERITED(kGrPremulInputFragmentProcessor_ClassID, src.optimizationFlags()) {}
     47 std::unique_ptr<GrFragmentProcessor> GrPremulInputFragmentProcessor::clone() const {
     48     return std::unique_ptr<GrFragmentProcessor>(new GrPremulInputFragmentProcessor(*this));
     49 }
     50