Flutter Engine
The Flutter Engine
SkSLModuleDataDefault.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2024 Google LLC
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
10
11#include <string>
12
13// We include minified SkSL module code and pass it directly to the compiler.
14#if defined(SK_ENABLE_OPTIMIZE_SIZE) || !defined(SK_DEBUG)
15 #include "src/sksl/generated/sksl_shared.minified.sksl"
16 #include "src/sksl/generated/sksl_compute.minified.sksl"
17 #include "src/sksl/generated/sksl_frag.minified.sksl"
18 #include "src/sksl/generated/sksl_gpu.minified.sksl"
19 #include "src/sksl/generated/sksl_public.minified.sksl"
20 #include "src/sksl/generated/sksl_rt_shader.minified.sksl"
21 #include "src/sksl/generated/sksl_vert.minified.sksl"
22 #if defined(SK_GRAPHITE)
23 #include "src/sksl/generated/sksl_graphite_frag.minified.sksl"
24 #include "src/sksl/generated/sksl_graphite_vert.minified.sksl"
25 #include "src/sksl/generated/sksl_graphite_frag_es2.minified.sksl"
26 #include "src/sksl/generated/sksl_graphite_vert_es2.minified.sksl"
27 #endif
28#else
29 #include "src/sksl/generated/sksl_shared.unoptimized.sksl"
30 #include "src/sksl/generated/sksl_compute.unoptimized.sksl"
31 #include "src/sksl/generated/sksl_frag.unoptimized.sksl"
32 #include "src/sksl/generated/sksl_gpu.unoptimized.sksl"
33 #include "src/sksl/generated/sksl_public.unoptimized.sksl"
34 #include "src/sksl/generated/sksl_rt_shader.unoptimized.sksl"
35 #include "src/sksl/generated/sksl_vert.unoptimized.sksl"
36 #if defined(SK_GRAPHITE)
37 #include "src/sksl/generated/sksl_graphite_frag.unoptimized.sksl"
38 #include "src/sksl/generated/sksl_graphite_vert.unoptimized.sksl"
39 #include "src/sksl/generated/sksl_graphite_frag_es2.unoptimized.sksl"
40 #include "src/sksl/generated/sksl_graphite_vert_es2.unoptimized.sksl"
41 #endif
42#endif
43
44namespace SkSL {
45
46std::string GetModuleData(ModuleName name, const char* /*filename*/) {
47#define M(name) case ModuleName::name: return std::string(SKSL_MINIFIED_##name);
48 switch (name) {
52 M(sksl_gpu)
56#if defined(SK_GRAPHITE)
61#endif
62 default:
64 }
65#undef M
66}
67
68} // namespace SkSL
#define SkUNREACHABLE
Definition: SkAssert.h:135
std::string GetModuleData(ModuleName name, const char *filename)
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
#define M(PROC, DITHER)