skia2/include/sksl/DSLModifiers.h
Ethan Nicholas daed2592bb Made SkSL DSL into public API
In addition to the unsurprising changes to eliminate references to
src/, we also had to tighten up some C++17-isms as they are not
permitted in public headers.

Change-Id: Ie5005a33d7a135e69fb66beca5e7a5f960dbd453
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378496
Reviewed-by: Brian Osman <brianosman@google.com>
2021-03-04 21:03:58 +00:00

52 lines
1021 B
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 DSLVar;
};
} // namespace dsl
} // namespace SkSL
#endif