diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 505a1cf2..f88e8918 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,6 +43,11 @@ on: description: "Enable Lottie Expressions" required: false default: true + feature_partial_rendering: + type: boolean + description: "Enable Partial Rendering (for thorvg)" + required: false + default: false feature_simd: type: boolean description: "Enable SIMD" @@ -135,6 +140,10 @@ jobs: features="${features}tvg-simd," fi + if [ "${{ github.event.inputs.feature_partial_rendering }}" = "true" ]; then + features="${features}tvg-partial," + fi + # Remove trailing comma if features exist if [ -n "$features" ]; then features="${features%,}" @@ -216,6 +225,10 @@ jobs: features="${features}tvg-simd," fi + if [ "${{ github.event.inputs.feature_partial_rendering }}" = "true" ]; then + features="${features}tvg-partial," + fi + # Remove trailing comma if features exist if [ -n "$features" ]; then features="${features%,}" @@ -286,6 +299,10 @@ jobs: features="${features}tvg-lottie-expressions," fi + if [ "${{ github.event.inputs.feature_partial_rendering }}" = "true" ]; then + features="${features}tvg-partial," + fi + # Remove trailing comma if features exist if [ -n "$features" ]; then features="${features%,}" @@ -362,6 +379,10 @@ jobs: features="${features}tvg-simd," fi + if [ "${{ github.event.inputs.feature_partial_rendering }}" = "true" ]; then + features="${features}tvg-partial," + fi + # Remove trailing comma if features exist if [ -n "$features" ]; then features="${features%,}" diff --git a/dotlottie-ffi/Cargo.toml b/dotlottie-ffi/Cargo.toml index 5463f128..0bab1ac1 100644 --- a/dotlottie-ffi/Cargo.toml +++ b/dotlottie-ffi/Cargo.toml @@ -20,7 +20,7 @@ name = "uniffi-bindgen" path = "uniffi-bindgen.rs" [features] -default = ["tvg", "tvg-sw", "ffi"] +default = ["tvg", "tvg-sw", "tvg-partial", "ffi"] tvg = ["dotlottie-rs/tvg"] tvg-sw = ["dotlottie-rs/tvg-sw"] tvg-webp = ["dotlottie-rs/tvg-webp"] @@ -30,6 +30,7 @@ tvg-ttf = ["dotlottie-rs/tvg-ttf"] tvg-threads = ["dotlottie-rs/tvg-threads"] tvg-lottie-expressions = ["dotlottie-rs/tvg-lottie-expressions"] tvg-simd = ["dotlottie-rs/tvg-simd"] +tvg-partial = ["dotlottie-rs/tvg-partial"] tvg-log = ["dotlottie-rs/tvg-log"] ffi = [] uniffi = [] diff --git a/dotlottie-rs/Cargo.toml b/dotlottie-rs/Cargo.toml index 21cc778a..b0f17ab6 100644 --- a/dotlottie-rs/Cargo.toml +++ b/dotlottie-rs/Cargo.toml @@ -8,7 +8,7 @@ links = "thorvg" crate-type = ["staticlib", "cdylib", "rlib"] [features] -dev = ["tvg", "tvg-sw", "tvg-lottie-expressions", "tvg-threads", "tvg-png", "tvg-jpg", "tvg-webp", "tvg-ttf"] +dev = ["tvg", "tvg-sw", "tvg-lottie-expressions", "tvg-threads", "tvg-png", "tvg-jpg", "tvg-webp", "tvg-ttf", "tvg-partial"] tvg = [] tvg-log = [] tvg-sw = [] @@ -19,6 +19,7 @@ tvg-webp = [] tvg-ttf = [] tvg-threads = [] tvg-simd = [] +tvg-partial = [] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/dotlottie-rs/build.rs b/dotlottie-rs/build.rs index d303477a..acc229e4 100644 --- a/dotlottie-rs/build.rs +++ b/dotlottie-rs/build.rs @@ -87,6 +87,10 @@ mod thorvg { writeln!(thorvg_config_h, "#define THORVG_THREAD_SUPPORT")?; } + if cfg!(feature = "tvg-partial") { + writeln!(thorvg_config_h, "#define THORVG_PARTIAL_RENDER_SUPPORT")?; + } + let tvg_sw_enabled = cfg!(feature = "tvg-sw"); if tvg_sw_enabled { writeln!(thorvg_config_h, "#define THORVG_SW_RASTER_SUPPORT")?;