skia2/tests/sksl/dslfp/GrDSLFPTest_Ternary.h
John Stiles b9fc6e45c2 Support 'layout(when)' expressions in DSL C++.
This required some changes to how we name variables in DSL.
When-expressions are designed to expect a local C++ variable with the
same name as the layout key. This constraint means our DSLVar variables
CANNOT have the same name as the layout key. Now, all DSL variables are
given a prefix. We try to keep the code tidy by using just a leading
underscore as the prefix, where it's safe to do so. (The C++ naming
rules put some underscore-names out of bounds, but underscore followed
by a lowercase letter is safe.)

Change-Id: Iaa8878042329b9909096f05712d5cf636ea01822
Bug: skia:11854
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400623
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-04-26 15:17:38 +00:00

47 lines
1.9 KiB
C++

/**************************************************************************************************
*** This file was autogenerated from GrDSLFPTest_Ternary.fp; do not modify.
**************************************************************************************************/
#ifndef GrDSLFPTest_Ternary_DEFINED
#define GrDSLFPTest_Ternary_DEFINED
#include "include/core/SkM44.h"
#include "include/core/SkTypes.h"
#include "src/gpu/GrFragmentProcessor.h"
class GrDSLFPTest_Ternary : public GrFragmentProcessor {
public:
static std::unique_ptr<GrFragmentProcessor> Make(bool primaryColors, SkPMColor4f colorGreen, SkPMColor4f colorRed, SkPMColor4f colorOrange, SkPMColor4f colorPurple) {
return std::unique_ptr<GrFragmentProcessor>(new GrDSLFPTest_Ternary(primaryColors, colorGreen, colorRed, colorOrange, colorPurple));
}
GrDSLFPTest_Ternary(const GrDSLFPTest_Ternary& src);
std::unique_ptr<GrFragmentProcessor> clone() const override;
const char* name() const override { return "DSLFPTest_Ternary"; }
bool primaryColors;
SkPMColor4f colorGreen;
SkPMColor4f colorRed;
SkPMColor4f colorOrange;
SkPMColor4f colorPurple;
private:
GrDSLFPTest_Ternary(bool primaryColors, SkPMColor4f colorGreen, SkPMColor4f colorRed, SkPMColor4f colorOrange, SkPMColor4f colorPurple)
: INHERITED(kGrDSLFPTest_Ternary_ClassID, kNone_OptimizationFlags)
, primaryColors(primaryColors)
, colorGreen(colorGreen)
, colorRed(colorRed)
, colorOrange(colorOrange)
, colorPurple(colorPurple) {
}
std::unique_ptr<GrGLSLFragmentProcessor> onMakeProgramImpl() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor&) const override;
#if GR_TEST_UTILS
SkString onDumpInfo() const override;
#endif
GR_DECLARE_FRAGMENT_PROCESSOR_TEST
using INHERITED = GrFragmentProcessor;
};
#endif