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#include "include/core/SkTypes.h"
14#include "include/core/SkM44.h"
15
16#include "src/gpu/gradients/GrGradientShader.h"
17#include "src/shaders/gradients/SkTwoPointConicalGradient.h"
18
19#include "src/gpu/GrCoordTransform.h"
20#include "src/gpu/GrFragmentProcessor.h"
21class GrTwoPointConicalGradientLayout : public GrFragmentProcessor {
22public:
23 enum class Type { kFocal = 2, kRadial = 0, kStrip = 1 };
24
25 static std::unique_ptr<GrFragmentProcessor> Make(const SkTwoPointConicalGradient& gradient,
26 const GrFPArgs& args);
27 GrTwoPointConicalGradientLayout(const GrTwoPointConicalGradientLayout& src);
28 std::unique_ptr<GrFragmentProcessor> clone() const override;
29 const char* name() const override { return "TwoPointConicalGradientLayout"; }
30 GrCoordTransform fCoordTransform0;
31 SkMatrix gradientMatrix;
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(SkMatrix gradientMatrix,
42 Type type,
43 bool isRadiusIncreasing,
44 bool isFocalOnCircle,
45 bool isWellBehaved,
46 bool isSwapped,
47 bool isNativelyFocal,
48 SkPoint focalParams)
49 : INHERITED(kGrTwoPointConicalGradientLayout_ClassID,
50 (OptimizationFlags)kNone_OptimizationFlags)
51 , fCoordTransform0(gradientMatrix)
52 , gradientMatrix(gradientMatrix)
53 , type(type)
54 , isRadiusIncreasing(isRadiusIncreasing)
55 , isFocalOnCircle(isFocalOnCircle)
56 , isWellBehaved(isWellBehaved)
57 , isSwapped(isSwapped)
58 , isNativelyFocal(isNativelyFocal)
59 , focalParams(focalParams) {
60 this->addCoordTransform(&fCoordTransform0);
61 }
62 GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
63 void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
64 bool onIsEqual(const GrFragmentProcessor&) const override;
65 GR_DECLARE_FRAGMENT_PROCESSOR_TEST
66 typedef GrFragmentProcessor INHERITED;
67};
68#endif
69