Debian Codegraph @

tools/glslminifier/src/GlslMinify.h

raw ◀ ▶
1 Debian patch touch this file
1 /*
2 * Copyright 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
•17 #include <cstdint>
18 #include <string>
19
20 #ifndef TNT_GLSLMINIFY_H
21 #define TNT_GLSLMINIFY_H
22
23 namespace glslminifier {
24
25 enum GlslMinifyOptions : uint32_t {
26 NONE = 0x0,
27
28 // Remove comments, both slash-slash (//) and slash-asterisk (/**/)
29 STRIP_COMMENTS = 0x1,
30
31 // Removes empty lines (two or more consecutive newlines are turned into one).
32 STRIP_EMPTY_LINES = 0x2,
33
34 // Removes indentation.
35 STRIP_INDENTATION = 0x4,
36
37 ALL = 0xFFFFFFFF
38 };
39
40 std::string minifyGlsl(const std::string& glsl,
41 GlslMinifyOptions options = GlslMinifyOptions::ALL) noexcept;
42
43 } // namespace glslminifier
44
45 #endif //TNT_GLSLMINIFY_H