Always enable SkSL's ByteCodeGenerator, disable interpreter in Google3

The ByteCodeGenerator is needed for SkSL-via-skvm, but almost no one
needs the ByteCode interpreter.

Bug: b/172773885
Change-Id: Ia7b6768dbc00c6c78b971ba50f0b702536bbd5b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336016
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2020-11-18 15:44:46 -05:00 committed by Skia Commit-Bot
parent 2d36627c8b
commit 1f71f433ff
3 changed files with 4 additions and 6 deletions

View File

@ -733,8 +733,6 @@ def base_defines(os_conditions):
"SK_CODEC_DECODES_JPEG",
"SK_ENCODE_JPEG",
"SK_HAS_ANDROID_CODEC",
# Needed for some tests in dm
"SK_ENABLE_SKSL_INTERPRETER",
] + skia_select(
os_conditions,
[

View File

@ -1796,7 +1796,6 @@ bool Compiler::toPipelineStage(Program& program, PipelineStageArgs* outArgs) {
#endif
std::unique_ptr<ByteCode> Compiler::toByteCode(Program& program) {
#if defined(SK_ENABLE_SKSL_INTERPRETER)
AutoSource as(this, program.fSource.get());
std::unique_ptr<ByteCode> result(new ByteCode());
ByteCodeGenerator cg(fContext.get(), &program, this, result.get());
@ -1804,9 +1803,6 @@ std::unique_ptr<ByteCode> Compiler::toByteCode(Program& program) {
if (success) {
return result;
}
#else
ABORT("ByteCode interpreter not enabled");
#endif
return nullptr;
}

View File

@ -13,6 +13,8 @@
#include "tests/Test.h"
#if defined(SK_ENABLE_SKSL_INTERPRETER)
static bool nearly_equal(const float a[], const float b[], int count) {
for (int i = 0; i < count; ++i) {
if (!SkScalarNearlyEqual(a[i], b[i])) {
@ -1244,3 +1246,5 @@ DEF_TEST(SkSLInterpreterExternalValuesVectorCall, r) {
printf("%s\n%s", src, compiler.errorText().c_str());
}
}
#endif // SK_ENABLE_SKSL_INTERPRETER