• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 GrClampedGradientEffect.fp; do not modify.
10  **************************************************************************************************/
11 #ifndef GrClampedGradientEffect_DEFINED
12 #define GrClampedGradientEffect_DEFINED
13 #include "SkTypes.h"
14 #include "GrFragmentProcessor.h"
15 #include "GrCoordTransform.h"
16 class GrClampedGradientEffect : public GrFragmentProcessor {
17 public:
leftBorderColor()18     const SkPMColor4f& leftBorderColor() const { return fLeftBorderColor; }
rightBorderColor()19     const SkPMColor4f& rightBorderColor() const { return fRightBorderColor; }
makePremul()20     bool makePremul() const { return fMakePremul; }
colorsAreOpaque()21     bool colorsAreOpaque() const { return fColorsAreOpaque; }
Make(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,SkPMColor4f leftBorderColor,SkPMColor4f rightBorderColor,bool makePremul,bool colorsAreOpaque)22     static std::unique_ptr<GrFragmentProcessor> Make(
23             std::unique_ptr<GrFragmentProcessor> colorizer,
24             std::unique_ptr<GrFragmentProcessor> gradLayout, SkPMColor4f leftBorderColor,
25             SkPMColor4f rightBorderColor, bool makePremul, bool colorsAreOpaque) {
26         return std::unique_ptr<GrFragmentProcessor>(new GrClampedGradientEffect(
27                 std::move(colorizer), std::move(gradLayout), leftBorderColor, rightBorderColor,
28                 makePremul, colorsAreOpaque));
29     }
30     GrClampedGradientEffect(const GrClampedGradientEffect& src);
31     std::unique_ptr<GrFragmentProcessor> clone() const override;
name()32     const char* name() const override { return "ClampedGradientEffect"; }
33 
34 private:
GrClampedGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer,std::unique_ptr<GrFragmentProcessor> gradLayout,SkPMColor4f leftBorderColor,SkPMColor4f rightBorderColor,bool makePremul,bool colorsAreOpaque)35     GrClampedGradientEffect(std::unique_ptr<GrFragmentProcessor> colorizer,
36                             std::unique_ptr<GrFragmentProcessor> gradLayout,
37                             SkPMColor4f leftBorderColor, SkPMColor4f rightBorderColor,
38                             bool makePremul, bool colorsAreOpaque)
39             : INHERITED(kGrClampedGradientEffect_ClassID,
40                         (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag |
41                                 (colorsAreOpaque && gradLayout->preservesOpaqueInput()
42                                          ? kPreservesOpaqueInput_OptimizationFlag
43                                          : kNone_OptimizationFlags))
44             , fLeftBorderColor(leftBorderColor)
45             , fRightBorderColor(rightBorderColor)
46             , fMakePremul(makePremul)
47             , fColorsAreOpaque(colorsAreOpaque) {
48         this->registerChildProcessor(std::move(colorizer));
49         this->registerChildProcessor(std::move(gradLayout));
50     }
51     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
52     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
53     bool onIsEqual(const GrFragmentProcessor&) const override;
54     GR_DECLARE_FRAGMENT_PROCESSOR_TEST
55     SkPMColor4f fLeftBorderColor;
56     SkPMColor4f fRightBorderColor;
57     bool fMakePremul;
58     bool fColorsAreOpaque;
59     typedef GrFragmentProcessor INHERITED;
60 };
61 #endif
62