blob: d7f83fad8a9033de8f789093bfddb714f318b428 [file] [log] [blame]
ethannicholasb3058bd2016-07-01 08:22:01 -07001/*
2 * Copyright 2016 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#ifndef SKSL_EXTENSION
9#define SKSL_EXTENSION
10
11#include "SkSLProgramElement.h"
12
13namespace SkSL {
14
15/**
16 * An extension declaration.
17 */
18struct Extension : public ProgramElement {
Greg Daniel792d0f12016-11-20 14:53:35 +000019 Extension(Position position, std::string name)
ethannicholasb3058bd2016-07-01 08:22:01 -070020 : INHERITED(position, kExtension_Kind)
21 , fName(std::move(name)) {}
22
Greg Daniel792d0f12016-11-20 14:53:35 +000023 std::string description() const override {
ethannicholasb3058bd2016-07-01 08:22:01 -070024 return "#extension " + fName + " : enable";
25 }
26
Greg Daniel792d0f12016-11-20 14:53:35 +000027 const std::string fName;
ethannicholasb3058bd2016-07-01 08:22:01 -070028
29 typedef ProgramElement INHERITED;
30};
31
32} // namespace
33
34#endif