Home | History | Annotate | Download | only in gradients
      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 GrDualIntervalGradientColorizer.fp; do not modify.
     10  **************************************************************************************************/
     11 #ifndef GrDualIntervalGradientColorizer_DEFINED
     12 #define GrDualIntervalGradientColorizer_DEFINED
     13 #include "SkTypes.h"
     14 #include "GrFragmentProcessor.h"
     15 #include "GrCoordTransform.h"
     16 class GrDualIntervalGradientColorizer : public GrFragmentProcessor {
     17 public:
     18     const SkPMColor4f& scale01() const { return fScale01; }
     19     const SkPMColor4f& bias01() const { return fBias01; }
     20     const SkPMColor4f& scale23() const { return fScale23; }
     21     const SkPMColor4f& bias23() const { return fBias23; }
     22     float threshold() const { return fThreshold; }
     23 
     24     static std::unique_ptr<GrFragmentProcessor> Make(const SkPMColor4f& c0, const SkPMColor4f& c1,
     25                                                      const SkPMColor4f& c2, const SkPMColor4f& c3,
     26                                                      float threshold);
     27     GrDualIntervalGradientColorizer(const GrDualIntervalGradientColorizer& src);
     28     std::unique_ptr<GrFragmentProcessor> clone() const override;
     29     const char* name() const override { return "DualIntervalGradientColorizer"; }
     30 
     31 private:
     32     GrDualIntervalGradientColorizer(SkPMColor4f scale01, SkPMColor4f bias01, SkPMColor4f scale23,
     33                                     SkPMColor4f bias23, float threshold)
     34             : INHERITED(kGrDualIntervalGradientColorizer_ClassID, kNone_OptimizationFlags)
     35             , fScale01(scale01)
     36             , fBias01(bias01)
     37             , fScale23(scale23)
     38             , fBias23(bias23)
     39             , fThreshold(threshold) {}
     40     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
     41     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
     42     bool onIsEqual(const GrFragmentProcessor&) const override;
     43     GR_DECLARE_FRAGMENT_PROCESSOR_TEST
     44     SkPMColor4f fScale01;
     45     SkPMColor4f fBias01;
     46     SkPMColor4f fScale23;
     47     SkPMColor4f fBias23;
     48     float fThreshold;
     49     typedef GrFragmentProcessor INHERITED;
     50 };
     51 #endif
     52