2021-01-27 12:53:46 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2020 Google LLC
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SKSL_DSL_MODIFIERS
|
|
|
|
#define SKSL_DSL_MODIFIERS
|
|
|
|
|
2021-03-04 19:30:25 +00:00
|
|
|
#include "include/private/SkSLModifiers.h"
|
2021-02-11 20:18:31 +00:00
|
|
|
#include "include/private/SkTArray.h"
|
|
|
|
|
2021-01-27 12:53:46 +00:00
|
|
|
namespace SkSL {
|
|
|
|
|
|
|
|
namespace dsl {
|
|
|
|
|
2021-02-11 20:18:31 +00:00
|
|
|
class DSLField;
|
|
|
|
class DSLType;
|
|
|
|
|
2021-01-27 12:53:46 +00:00
|
|
|
enum Modifier {
|
|
|
|
kNo_Modifier = 0,
|
|
|
|
kConst_Modifier = 1 << 0,
|
|
|
|
kIn_Modifier = 1 << 1,
|
|
|
|
kOut_Modifier = 1 << 2,
|
|
|
|
kInOut_Modifier = kIn_Modifier | kOut_Modifier,
|
|
|
|
kUniform_Modifier = 1 << 3,
|
|
|
|
kFlat_Modifier = 1 << 4,
|
|
|
|
kNoPerspective_Modifier = 1 << 5,
|
|
|
|
};
|
|
|
|
|
|
|
|
class DSLModifiers {
|
|
|
|
public:
|
|
|
|
|
|
|
|
DSLModifiers() {}
|
|
|
|
|
|
|
|
DSLModifiers(int flags)
|
|
|
|
: fModifiers(SkSL::Layout(), flags) {}
|
|
|
|
|
|
|
|
private:
|
|
|
|
SkSL::Modifiers fModifiers;
|
|
|
|
|
2021-02-11 20:18:31 +00:00
|
|
|
friend DSLType Struct(const char* name, SkTArray<DSLField> fields);
|
2021-01-27 12:53:46 +00:00
|
|
|
friend class DSLVar;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dsl
|
|
|
|
|
|
|
|
} // namespace SkSL
|
|
|
|
|
|
|
|
#endif
|