Enable SKSL in skia_nanobench, enforce resources being present.
Don't include SKSL interpreter bench when interpreter is disabled.
Bug: b/141263986 b/141871494
Change-Id: Ie9a5f3f28b28af077f7279da0d20bfafb41bd6cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247054
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Pirama Arumuga Nainar <pirama@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
diff --git a/bench/SkSLInterpreterBench.cpp b/bench/SkSLInterpreterBench.cpp
index f7a189d..22afd28 100644
--- a/bench/SkSLInterpreterBench.cpp
+++ b/bench/SkSLInterpreterBench.cpp
@@ -4,11 +4,15 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "bench/Benchmark.h"
#include "include/utils/SkRandom.h"
#include "src/sksl/SkSLByteCode.h"
#include "src/sksl/SkSLCompiler.h"
+// Without this build flag, this bench isn't runnable.
+#if defined(SK_ENABLE_SKSL_INTERPRETER)
+
// Benchmarks the interpreter with a function that has a color-filter style signature
class SkSLInterpreterCFBench : public Benchmark {
public:
@@ -140,3 +144,4 @@
DEF_BENCH(return new SkSLInterpreterCFBench("lumaToAlpha", 256, kLumaToAlphaSrc));
DEF_BENCH(return new SkSLInterpreterCFBench("hcf", 256, kHighContrastFilterSrc));
+#endif // SK_ENABLE_SKSL_INTERPRETER
diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py
index b16d5f7..2443358 100644
--- a/gn/gn_to_bp.py
+++ b/gn/gn_to_bp.py
@@ -310,6 +310,10 @@
'skia_enable_fontmgr_win_gdi': 'false',
'skia_use_fonthost_mac': 'false',
+ # enable features used in skia_nanobench
+ 'skia_enable_sksl_interpreter': 'true',
+ 'skia_tools_require_resources': 'true',
+
'skia_use_freetype': 'true',
'skia_use_fontconfig': 'false',
'skia_use_fixed_gamma_text': 'true',