From 3ab6d7dcf31ecf20b99f107e31158b5192d803cd Mon Sep 17 00:00:00 2001 From: John Stiles Date: Wed, 26 Apr 2023 16:30:16 -0400 Subject: [PATCH] Switch Bazel builds to use SkRP by default. This CL gives our Bazel builds the same default settings as our GN builds (as of http://review.skia.org/676617). This change led to some minor IWYU ripples as well. Change-Id: I4503ca9a6381ad3817d19b10baadf9645e3faaef Reviewed-on: https://skia-review.googlesource.com/c/skia/+/682976 Auto-Submit: John Stiles Commit-Queue: John Stiles Reviewed-by: Chris Mumford --- bazel/common_config_settings/BUILD.bazel | 4 ++-- defines.bzl | 2 ++ src/sksl/codegen/SkSLRasterPipelineBuilder.cpp | 8 ++++---- src/sksl/codegen/SkSLRasterPipelineBuilder.h | 2 -- src/sksl/codegen/SkSLVMCodeGenerator.cpp | 6 +++--- src/sksl/codegen/SkSLVMCodeGenerator.h | 7 ++++--- tests/SkVMTest.cpp | 7 ++++--- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/bazel/common_config_settings/BUILD.bazel b/bazel/common_config_settings/BUILD.bazel index 19c7d36a6153..de931a345e41 100644 --- a/bazel/common_config_settings/BUILD.bazel +++ b/bazel/common_config_settings/BUILD.bazel @@ -205,12 +205,12 @@ bool_flag( bool_flag( name = "enable_skvm", - default = True, + default = False, ) bool_flag( name = "enable_sksl_in_raster_pipeline", - default = False, + default = True, ) bool_flag( diff --git a/defines.bzl b/defines.bzl index d4a0fcc0c1f5..7b0ee4f63634 100644 --- a/defines.bzl +++ b/defines.bzl @@ -40,6 +40,8 @@ GENERAL_DEFINES = [ "//src/sksl:enable_skslc_true": [ "SKSL_STANDALONE", "SK_DISABLE_TRACING", + "SK_ENABLE_SKSL_IN_RASTER_PIPELINE", + "SK_ENABLE_SKVM", "SK_ENABLE_SPIRV_CROSS", "SK_ENABLE_SPIRV_VALIDATION", "SK_ENABLE_WGSL_VALIDATION", diff --git a/src/sksl/codegen/SkSLRasterPipelineBuilder.cpp b/src/sksl/codegen/SkSLRasterPipelineBuilder.cpp index 2fb98899dbcf..1b1504e6cff1 100644 --- a/src/sksl/codegen/SkSLRasterPipelineBuilder.cpp +++ b/src/sksl/codegen/SkSLRasterPipelineBuilder.cpp @@ -1422,12 +1422,13 @@ Program::SlotData Program::allocateSlotData(SkArenaAlloc* alloc) const { return s; } -#if !defined(SKSL_STANDALONE) - bool Program::appendStages(SkRasterPipeline* pipeline, SkArenaAlloc* alloc, RP::Callbacks* callbacks, SkSpan uniforms) const { +#if defined(SKSL_STANDALONE) + return false; +#else // Convert our Instruction list to an array of ProgramOps. TArray stages; SlotData slotData = this->allocateSlotData(alloc); @@ -1539,9 +1540,8 @@ bool Program::appendStages(SkRasterPipeline* pipeline, } return true; -} - #endif +} void Program::makeStages(TArray* pipeline, SkArenaAlloc* alloc, diff --git a/src/sksl/codegen/SkSLRasterPipelineBuilder.h b/src/sksl/codegen/SkSLRasterPipelineBuilder.h index d1f8aeff2bc0..875f791a17da 100644 --- a/src/sksl/codegen/SkSLRasterPipelineBuilder.h +++ b/src/sksl/codegen/SkSLRasterPipelineBuilder.h @@ -164,12 +164,10 @@ class Program { DebugTracePriv* debugTrace); ~Program(); -#if !defined(SKSL_STANDALONE) bool appendStages(SkRasterPipeline* pipeline, SkArenaAlloc* alloc, Callbacks* callbacks, SkSpan uniforms) const; -#endif void dump(SkWStream* out) const; diff --git a/src/sksl/codegen/SkSLVMCodeGenerator.cpp b/src/sksl/codegen/SkSLVMCodeGenerator.cpp index c79c65ea8593..5e28381ab582 100644 --- a/src/sksl/codegen/SkSLVMCodeGenerator.cpp +++ b/src/sksl/codegen/SkSLVMCodeGenerator.cpp @@ -5,14 +5,16 @@ * found in the LICENSE file. */ +#include "include/core/SkTypes.h" #include "src/sksl/codegen/SkSLVMCodeGenerator.h" +#if defined(SK_ENABLE_SKVM) + #include "include/core/SkBlendMode.h" #include "include/core/SkColor.h" #include "include/core/SkColorType.h" #include "include/core/SkPoint.h" #include "include/core/SkSpan.h" -#include "include/core/SkTypes.h" #include "include/private/SkSLDefines.h" #include "include/private/base/SkFloatingPoint.h" #include "include/private/base/SkTArray.h" @@ -72,8 +74,6 @@ #include #include -#if defined(SK_ENABLE_SKVM) - using namespace skia_private; namespace { diff --git a/src/sksl/codegen/SkSLVMCodeGenerator.h b/src/sksl/codegen/SkSLVMCodeGenerator.h index 1843b32c980d..c4a73a3ef4f9 100644 --- a/src/sksl/codegen/SkSLVMCodeGenerator.h +++ b/src/sksl/codegen/SkSLVMCodeGenerator.h @@ -8,14 +8,15 @@ #ifndef SKSL_VMGENERATOR #define SKSL_VMGENERATOR -#include "src/core/SkVM.h" +#include "include/core/SkTypes.h" + +#if defined(SK_ENABLE_SKVM) +#include "src/core/SkVM.h" #include template class SkSpan; -#if defined(SK_ENABLE_SKVM) - namespace SkSL { class FunctionDefinition; diff --git a/tests/SkVMTest.cpp b/tests/SkVMTest.cpp index 5dd23c2a081b..86110fcee141 100644 --- a/tests/SkVMTest.cpp +++ b/tests/SkVMTest.cpp @@ -5,9 +5,12 @@ * found in the LICENSE file. */ +#include "include/core/SkTypes.h" + +#if defined(SK_ENABLE_SKVM) + #include "include/core/SkColorType.h" #include "include/core/SkScalar.h" -#include "include/core/SkTypes.h" #include "include/private/base/SkDebug.h" #include "include/private/base/SkFloatingPoint.h" #include "src/base/SkMSAN.h" @@ -22,8 +25,6 @@ #include #include -#if defined(SK_ENABLE_SKVM) - template static void test_jit_and_interpreter(const skvm::Builder& b, Fn&& test) { skvm::Program p = b.done();