skia2/include/sksl/DSLModifiers.h
Ethan Nicholas 624a529fbd Added an API for creating RuntimeEffects using the SkSL DSL.
Change-Id: I305016d305455e2b90fe904d8da93cf7735cc38e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389316
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
2021-04-16 19:36:54 +00:00

54 lines
1.1 KiB
C++

/*
* 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
#include "include/private/SkSLModifiers.h"
#include "include/private/SkTArray.h"
namespace SkSL {
namespace dsl {
class DSLField;
class DSLType;
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;
friend DSLType Struct(const char* name, SkTArray<DSLField> fields);
friend class DSLFunction;
friend class DSLVar;
friend class DSLWriter;
};
} // namespace dsl
} // namespace SkSL
#endif