aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD.gn3
-rw-r--r--METADATA4
-rw-r--r--android/include/config/SkUserConfig.h4
-rw-r--r--gn/skia.gni5
-rw-r--r--linux/include/config/SkUserConfig.h4
-rw-r--r--mac/include/config/SkUserConfig.h4
-rw-r--r--renderengine/include/config/SkUserConfig.h4
-rw-r--r--skqp/include/config/SkUserConfig.h4
-rw-r--r--src/core/SkVMBlitter.cpp4
-rw-r--r--src/core/SkVMBlitter.h32
-rw-r--r--tools/viewer/Viewer.cpp8
-rw-r--r--tools/viewer/Viewer.h2
-rw-r--r--win/include/config/SkUserConfig.h4
13 files changed, 77 insertions, 5 deletions
diff --git a/BUILD.gn b/BUILD.gn
index c720375100..d847454b9e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -51,6 +51,9 @@ config("skia_public") {
if (skia_enable_sksl_in_raster_pipeline) {
defines += [ "SK_ENABLE_SKSL_IN_RASTER_PIPELINE" ]
}
+ if (skia_enable_skvm) {
+ defines += [ "SK_ENABLE_SKVM" ]
+ }
if (skia_enable_precompile) {
defines += [ "SK_ENABLE_PRECOMPILE" ]
}
diff --git a/METADATA b/METADATA
index eb0fa9bc7d..545315abbe 100644
--- a/METADATA
+++ b/METADATA
@@ -9,11 +9,11 @@ third_party {
type: GIT
value: "https://skia.googlesource.com/skia"
}
- version: "07bb369e8e90f5f484e813f560e8b84b6e064105"
+ version: "da103f0954a5b85f55b0bb2b6f1b6b418c484fb7"
license_type: RECIPROCAL
last_upgrade_date {
year: 2023
month: 4
- day: 20
+ day: 21
}
}
diff --git a/android/include/config/SkUserConfig.h b/android/include/config/SkUserConfig.h
index bfc639a62d..9ff85dd550 100644
--- a/android/include/config/SkUserConfig.h
+++ b/android/include/config/SkUserConfig.h
@@ -43,6 +43,10 @@
#define SK_ENABLE_SKSL
#endif
+#ifndef SK_ENABLE_SKVM
+#define SK_ENABLE_SKVM
+#endif
+
#ifndef SK_GAMMA_APPLY_TO_A8
#define SK_GAMMA_APPLY_TO_A8
#endif
diff --git a/gn/skia.gni b/gn/skia.gni
index caa046cb74..b0c90b6a0a 100644
--- a/gn/skia.gni
+++ b/gn/skia.gni
@@ -25,8 +25,7 @@ declare_args() {
(is_wasm && skia_canvaskit_enable_skottie)
skia_enable_precompile = true
skia_enable_sksl = true
- skia_enable_sksl_in_raster_pipeline = false
- skia_enable_skvm_jit_when_possible = is_skia_dev_build
+ skia_enable_skvm = true
skia_enable_svg = !is_component_build
skia_enable_tools = is_skia_dev_build
skia_enable_gpu_debug_layers = is_skia_dev_build && is_debug
@@ -106,6 +105,8 @@ declare_args() {
}
declare_args() {
+ skia_enable_sksl_in_raster_pipeline = !skia_enable_skvm
+ skia_enable_skvm_jit_when_possible = is_skia_dev_build && skia_enable_skvm
skia_enable_sksl_tracing = is_skia_dev_build && !skia_enable_optimize_size
}
diff --git a/linux/include/config/SkUserConfig.h b/linux/include/config/SkUserConfig.h
index eacaa065ad..e79f5f4cee 100644
--- a/linux/include/config/SkUserConfig.h
+++ b/linux/include/config/SkUserConfig.h
@@ -35,6 +35,10 @@
#define SK_ENABLE_SKSL
#endif
+#ifndef SK_ENABLE_SKVM
+#define SK_ENABLE_SKVM
+#endif
+
#ifndef SK_GAMMA_APPLY_TO_A8
#define SK_GAMMA_APPLY_TO_A8
#endif
diff --git a/mac/include/config/SkUserConfig.h b/mac/include/config/SkUserConfig.h
index d05029d841..4ba8e605a0 100644
--- a/mac/include/config/SkUserConfig.h
+++ b/mac/include/config/SkUserConfig.h
@@ -43,6 +43,10 @@
#define SK_ENABLE_SKSL
#endif
+#ifndef SK_ENABLE_SKVM
+#define SK_ENABLE_SKVM
+#endif
+
#ifndef SK_GAMMA_APPLY_TO_A8
#define SK_GAMMA_APPLY_TO_A8
#endif
diff --git a/renderengine/include/config/SkUserConfig.h b/renderengine/include/config/SkUserConfig.h
index 9bdb4fd647..ecba49888a 100644
--- a/renderengine/include/config/SkUserConfig.h
+++ b/renderengine/include/config/SkUserConfig.h
@@ -19,6 +19,10 @@
#define SK_ENABLE_SKSL
#endif
+#ifndef SK_ENABLE_SKVM
+#define SK_ENABLE_SKVM
+#endif
+
#ifndef SK_GAMMA_APPLY_TO_A8
#define SK_GAMMA_APPLY_TO_A8
#endif
diff --git a/skqp/include/config/SkUserConfig.h b/skqp/include/config/SkUserConfig.h
index fcd787639a..6d6acc4889 100644
--- a/skqp/include/config/SkUserConfig.h
+++ b/skqp/include/config/SkUserConfig.h
@@ -43,6 +43,10 @@
#define SK_ENABLE_SKSL
#endif
+#ifndef SK_ENABLE_SKVM
+#define SK_ENABLE_SKVM
+#endif
+
#ifndef SK_GAMMA_APPLY_TO_A8
#define SK_GAMMA_APPLY_TO_A8
#endif
diff --git a/src/core/SkVMBlitter.cpp b/src/core/SkVMBlitter.cpp
index 4b0702666f..38e64e199f 100644
--- a/src/core/SkVMBlitter.cpp
+++ b/src/core/SkVMBlitter.cpp
@@ -24,6 +24,8 @@
#include <cinttypes>
+#ifdef SK_ENABLE_SKVM
+
#define SK_BLITTER_TRACE_IS_SKVM
#include "src/utils/SkBlitterTrace.h"
@@ -813,3 +815,5 @@ SkVMBlitter* SkVMBlitter::Make(const SkPixmap& device,
&ok);
return ok ? blitter : nullptr;
}
+
+#endif // SK_ENABLE_SKVM
diff --git a/src/core/SkVMBlitter.h b/src/core/SkVMBlitter.h
index 5c49be8a15..9cf0eb7d35 100644
--- a/src/core/SkVMBlitter.h
+++ b/src/core/SkVMBlitter.h
@@ -15,6 +15,8 @@
#include "src/core/SkLRUCache.h"
#include "src/core/SkVM.h"
+#ifdef SK_ENABLE_SKVM
+
class SkVMBlitter final : public SkBlitter {
public:
static SkVMBlitter* Make(const SkPixmap& dst,
@@ -110,4 +112,34 @@ private:
friend class Viewer;
};
+
+#else
+
+class SkVMBlitter final : public SkBlitter {
+public:
+ static SkVMBlitter* Make(const SkPixmap&,
+ const SkPaint&,
+ const SkMatrix&,
+ SkArenaAlloc*,
+ sk_sp<SkShader>) {
+ return nullptr;
+ }
+
+ static SkVMBlitter* Make(const SkPixmap&,
+ const SkPaint&,
+ const SkPixmap&,
+ int,
+ int,
+ SkArenaAlloc*,
+ sk_sp<SkShader>) {
+ return nullptr;
+ }
+
+ void blitH(int, int, int) override {}
+ void blitAntiH(int, int, const SkAlpha[], const int16_t[]) override {}
+
+ ~SkVMBlitter() override = default;
+};
+
+#endif // SK_ENABLE_SKVM
#endif // SkVMBlitter_DEFINED
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index c8f9adc099..822aa5ebb1 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -1961,6 +1961,8 @@ static std::string build_glsl_highlight_shader(const GrShaderCaps& shaderCaps) {
return highlight;
}
+#ifdef SK_ENABLE_SKVM
+
static skvm::Program build_skvm_highlight_program(SkColorType ct, int nargs) {
// Code here is heavily tied to (and inspired by) SkVMBlitter::BuildProgram
skvm::Builder b;
@@ -1984,6 +1986,8 @@ static skvm::Program build_skvm_highlight_program(SkColorType ct, int nargs) {
return b.done();
}
+#endif
+
void Viewer::drawImGui() {
// Support drawing the ImGui demo window. Superfluous, but gives a good idea of what's possible
if (fShowImGuiTestWindow) {
@@ -2759,6 +2763,7 @@ void Viewer::drawImGui() {
}
}
+#ifdef SK_ENABLE_SKVM
if (ImGui::CollapsingHeader("SkVM")) {
auto* cache = SkVMBlitter::TryAcquireProgramCache();
SkASSERT(cache);
@@ -2810,7 +2815,7 @@ void Viewer::drawImGui() {
std::string((const char*)asmData->data(), asmData->size()));
}
stringBox("##ASM", asmString);
-#endif
+#endif // defined(SKVM_JIT)
ImGui::TreePop();
}
@@ -2828,6 +2833,7 @@ void Viewer::drawImGui() {
SkVMBlitter::ReleaseProgramCache();
}
+#endif // SK_ENABLE_SKVM
}
if (displayParamsChanged || uiParamsChanged) {
fDeferredActions.push_back([=]() {
diff --git a/tools/viewer/Viewer.h b/tools/viewer/Viewer.h
index 5c560587ef..68a38ee200 100644
--- a/tools/viewer/Viewer.h
+++ b/tools/viewer/Viewer.h
@@ -275,10 +275,12 @@ private:
};
ShaderOptLevel fOptLevel = kShaderOptLevel_Source;
+#ifdef SK_ENABLE_SKVM
SkVMBlitter::Key fHoveredKey;
skvm::Program fHoveredProgram;
skia_private::THashMap<SkVMBlitter::Key, std::string> fDisassemblyCache;
+#endif
};
#endif
diff --git a/win/include/config/SkUserConfig.h b/win/include/config/SkUserConfig.h
index 5c78cc2105..99136fc704 100644
--- a/win/include/config/SkUserConfig.h
+++ b/win/include/config/SkUserConfig.h
@@ -35,6 +35,10 @@
#define SK_ENABLE_SKSL
#endif
+#ifndef SK_ENABLE_SKVM
+#define SK_ENABLE_SKVM
+#endif
+
#ifndef SK_GAMMA_APPLY_TO_A8
#define SK_GAMMA_APPLY_TO_A8
#endif