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 GrTwoPointConicalGradientLayout.fp; do not modify.
10 **************************************************************************************************/
11#ifndef GrTwoPointConicalGradientLayout_DEFINED
12#define GrTwoPointConicalGradientLayout_DEFINED
13
14#include "include/core/SkM44.h"
15#include "include/core/SkTypes.h"
16
17#include "src/gpu/effects/GrMatrixEffect.h"
18#include "src/gpu/gradients/GrGradientShader.h"
19#include "src/shaders/gradients/SkTwoPointConicalGradient.h"
20
21#include "src/gpu/GrFragmentProcessor.h"
22
23class GrTwoPointConicalGradientLayout : public GrFragmentProcessor {
24public:
25 enum class Type { kFocal = 2, kRadial = 0, kStrip = 1 };
26
27 static std::unique_ptr<GrFragmentProcessor> Make(const SkTwoPointConicalGradient& gradient,
28 const GrFPArgs& args);
29 GrTwoPointConicalGradientLayout(const GrTwoPointConicalGradientLayout& src);
30 std::unique_ptr<GrFragmentProcessor> clone() const override;
31 const char* name() const override { return "TwoPointConicalGradientLayout"; }
32 Type type;
33 bool isRadiusIncreasing;
34 bool isFocalOnCircle;
35 bool isWellBehaved;
36 bool isSwapped;
37 bool isNativelyFocal;
38 SkPoint focalParams;
39
40private:
41 GrTwoPointConicalGradientLayout(Type type,
42 bool isRadiusIncreasing,
43 bool isFocalOnCircle,
44 bool isWellBehaved,
45 bool isSwapped,
46 bool isNativelyFocal,
47 SkPoint focalParams)
48 : INHERITED(kGrTwoPointConicalGradientLayout_ClassID,
49 (OptimizationFlags)kNone_OptimizationFlags)
50 , type(type)
51 , isRadiusIncreasing(isRadiusIncreasing)
52 , isFocalOnCircle(isFocalOnCircle)
53 , isWellBehaved(isWellBehaved)
54 , isSwapped(isSwapped)
55 , isNativelyFocal(isNativelyFocal)
56 , focalParams(focalParams) {
57 this->setUsesSampleCoordsDirectly();
58 }
59 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
60 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
61 bool onIsEqual(const GrFragmentProcessor&) const override;
62#if GR_TEST_UTILS
63 SkString onDumpInfo() const override;
64#endif
65 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
66 typedef GrFragmentProcessor INHERITED;
67};
68#endif
69