diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-06-27 11:20:22 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-27 18:27:57 +0000 |
commit | c070939fd1a954b7a492bc30f0cf64a664b90181 (patch) | |
tree | 6b1167726bc9ac4d2073f893c699b40c70f63ba1 /BUILD.gn | |
parent | 26249e0e1d1b18a1e67195a2998b49958426f8ba (diff) |
Re-land sksl fragment processor support
This reverts commit ed50200682e0de72c3abecaa4d5324ebcd1ed9f9.
Bug: skia:
Change-Id: I9caa7454b391450620d6989dc472abb3cf7a2cab
Reviewed-on: https://skia-review.googlesource.com/20965
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'BUILD.gn')
-rw-r--r-- | BUILD.gn | 77 |
1 files changed, 62 insertions, 15 deletions
@@ -139,6 +139,7 @@ config("skia_private") { "src/utils/win", "src/xml", "third_party/gif", + "$target_gen_dir", ] defines = [ "SK_GAMMA_APPLY_TO_A8" ] @@ -345,6 +346,9 @@ template("optional") { optional("effects") { enabled = skia_enable_effects + deps = [ + ":compile_processors", + ] sources = skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ] sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ] @@ -410,12 +414,68 @@ optional("fontmgr_fuchsia") { ] } +if (skia_enable_gpu && skia_gpu_processor_sources != []) { + executable("skslc") { + defines = [ "SKSL_STANDALONE" ] + sources = [ + "src/sksl/SkSLMain.cpp", + ] + sources += skia_sksl_sources + include_dirs = [ + "src/gpu", + "src/sksl", + ] + deps = [ + "//third_party/spirv-tools", + ] + } + + skia_gpu_processor_outputs = [] + foreach(src, skia_gpu_processor_sources) { + name = get_path_info(src, "name") + skia_gpu_processor_outputs += [ + "$target_gen_dir/effects/$name.h", + "$target_gen_dir/effects/$name.cpp", + ] + } + + action("compile_processors") { + script = "gn/compile_processors.py" + deps = [ + ":skslc(//gn/toolchain:$host_toolchain)", + ] + sources = skia_gpu_processor_sources + outputs = skia_gpu_processor_outputs + skslc_path = "$root_out_dir/" + if (host_toolchain != default_toolchain_name) { + skslc_path += "$host_toolchain/" + } + skslc_path += "skslc" + if (host_os == "win") { + skslc_path = ".exe" + } + args = [ + rebase_path(skslc_path), + rebase_path("$target_gen_dir/effects"), + ] + args += rebase_path(skia_gpu_processor_sources) + } +} else { + skia_gpu_processor_outputs = [] + group("compile_processors") { + } +} + optional("gpu") { enabled = skia_enable_gpu + deps = [ + ":compile_processors", + ] public_defines = [] sources = skia_gpu_sources + skia_sksl_sources + - [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] + [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] + + skia_gpu_processor_outputs # These paths need to be absolute to match the ones produced by shared_sources.gni. sources -= get_path_info([ @@ -454,9 +514,7 @@ optional("gpu") { } } if (skia_enable_spirv_validation) { - deps = [ - "//third_party/spirv-tools", - ] + deps += [ "//third_party/spirv-tools" ] public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ] } } @@ -1525,15 +1583,4 @@ if (skia_enable_tools) { ] } } - - if (skia_enable_gpu) { - test_app("skslc") { - defines = [ "SKSL_STANDALONE" ] - sources = [ - "src/sksl/SkSLMain.cpp", - ] - sources += skia_sksl_sources - include_dirs = [ "src/sksl" ] - } - } } |