vello_cpu: Add a `is_multi_threaded` method
diff --git a/sparse_strips/vello_cpu/src/dispatch/mod.rs b/sparse_strips/vello_cpu/src/dispatch/mod.rs index f9830f3..e035f8e 100644 --- a/sparse_strips/vello_cpu/src/dispatch/mod.rs +++ b/sparse_strips/vello_cpu/src/dispatch/mod.rs
@@ -92,4 +92,5 @@ encoded_paints: &[EncodedPaint], image_resolver: &dyn ImageResolver, ); + fn is_multi_threaded(&self) -> bool; }
diff --git a/sparse_strips/vello_cpu/src/dispatch/multi_threaded.rs b/sparse_strips/vello_cpu/src/dispatch/multi_threaded.rs index a587225..473a978 100644 --- a/sparse_strips/vello_cpu/src/dispatch/multi_threaded.rs +++ b/sparse_strips/vello_cpu/src/dispatch/multi_threaded.rs
@@ -656,6 +656,10 @@ self.flush_tasks(); self.clip_context.pop_clip(); } + + fn is_multi_threaded(&self) -> bool { + true + } } impl Debug for MultiThreadedDispatcher {
diff --git a/sparse_strips/vello_cpu/src/dispatch/single_threaded.rs b/sparse_strips/vello_cpu/src/dispatch/single_threaded.rs index b0053ce..ce5f1db 100644 --- a/sparse_strips/vello_cpu/src/dispatch/single_threaded.rs +++ b/sparse_strips/vello_cpu/src/dispatch/single_threaded.rs
@@ -863,6 +863,10 @@ fn pop_clip_path(&mut self) { self.clip_context.pop_clip(); } + + fn is_multi_threaded(&self) -> bool { + false + } } /// Saves a filtered pixmap to disk for debugging purposes.
diff --git a/sparse_strips/vello_cpu/src/render.rs b/sparse_strips/vello_cpu/src/render.rs index 2ab2e9f..734f249 100644 --- a/sparse_strips/vello_cpu/src/render.rs +++ b/sparse_strips/vello_cpu/src/render.rs
@@ -758,6 +758,12 @@ pub fn restore_state(&mut self, state: RenderState) { self.state = state; } + + /// Whether rendering is currently configured to run in multi-threaded mode. + #[doc(hidden)] + pub fn is_multi_threaded(&self) -> bool { + self.dispatcher.is_multi_threaded() + } } /// Image registry implementation.