Skip to content

Truly independent web browser

LibCompositing: Remove visual context queries that C++ no longer asks

Aliaksandr Kalenik3a0d6bf2d8d9
diff --git a/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.cpp b/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.cpp
index 5243867c297..167ee9f7aaf 100644
--- a/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.cpp
+++ b/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.cpp
@@ -154,14 +154,6 @@ AccumulatedVisualContextTree AccumulatedVisualContextTree::with_visual_animation
return adopt_rust_handle(Compositing::RustFFI::visual_context_tree_with_visual_animation_samples(m_rust_tree, monotonic_time_ns));
}
-Optional<float> AccumulatedVisualContextTree::effects_opacity(EffectNodeIndex effect) const
-{
- float opacity = 1;
- if (!Compositing::RustFFI::visual_context_tree_effects_opacity(m_rust_tree, effect, &opacity))
- return {};
- return opacity;
-}
-
Optional<Gfx::Color> AccumulatedVisualContextTree::sampled_background_color(EffectNodeIndex effect) const
{
Gfx::Color color;
@@ -170,14 +162,6 @@ Optional<Gfx::Color> AccumulatedVisualContextTree::sampled_background_color(Effe
return color;
}
-Vector<bool> AccumulatedVisualContextTree::spatial_nodes_in_subtrees_of(ReadonlySpan<SpatialNodeIndex> roots) const
-{
- Vector<bool> in_subtree;
- in_subtree.resize(spatial_node_count());
- Compositing::RustFFI::visual_context_tree_mark_spatial_subtrees(m_rust_tree, roots.data(), roots.size(), in_subtree.data(), in_subtree.size());
- return in_subtree;
-}
-
Optional<Gfx::FloatPoint> AccumulatedVisualContextTree::transform_point_for_hit_test(ContextRef context, Gfx::FloatPoint screen_point, ScrollStateSnapshot const& scroll_state, ClipBehavior clip_behavior) const
{
auto scroll_offsets = scroll_state.device_offsets();
@@ -216,16 +200,6 @@ Gfx::FloatMatrix4x4 AccumulatedVisualContextTree::accumulated_matrix(SpatialNode
return Compositing::RustFFI::visual_context_tree_accumulated_matrix(m_rust_tree, index, scroll_offsets.data(), scroll_offsets.size(), include_visual_viewport_transform == IncludeVisualViewportTransform::Yes);
}
-bool AccumulatedVisualContextTree::effect_is_isolated_by_layer(EffectNodeIndex effect) const
-{
- return Compositing::RustFFI::visual_context_tree_effect_is_isolated_by_layer(m_rust_tree, effect);
-}
-
-bool AccumulatedVisualContextTree::has_unisolated_destination_reading_effect() const
-{
- return Compositing::RustFFI::visual_context_tree_has_unisolated_destination_reading_effect(m_rust_tree);
-}
-
void AccumulatedVisualContextTree::for_each_effects_filter_image_frame_id(Function<void(u64)> const& visit) const
{
struct ImageFrameIdVisitor {
diff --git a/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.h b/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.h
index 5239398792e..a6dbc76ae24 100644
--- a/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.h
+++ b/Libraries/LibCompositing/DisplayList/AccumulatedVisualContext.h
@@ -80,10 +80,8 @@ public:
AccumulatedVisualContextTree with_visual_viewport_transform(TransformWithOrigin const&) const;
// A copy whose nodes carry the values the animations take at the time.
AccumulatedVisualContextTree with_visual_animation_samples(i64 monotonic_time_ns) const;
- Optional<float> effects_opacity(EffectNodeIndex) const;
// The sampled background color of a recorded fill's animation effect.
Optional<Gfx::Color> sampled_background_color(EffectNodeIndex) const;
- Vector<bool> spatial_nodes_in_subtrees_of(ReadonlySpan<SpatialNodeIndex> roots) const;
Optional<Gfx::FloatPoint> transform_point_for_hit_test(ContextRef, Gfx::FloatPoint, ScrollStateSnapshot const&, ClipBehavior = ClipBehavior::Respect) const;
Gfx::FloatPoint inverse_transform_point(SpatialNodeIndex, Gfx::FloatPoint) const;
@@ -92,8 +90,6 @@ public:
Gfx::FloatPoint cumulative_scroll_chain_offset(SpatialNodeIndex, ScrollStateSnapshot const&) const;
Gfx::FloatMatrix4x4 accumulated_matrix(SpatialNodeIndex, ScrollStateSnapshot const&, IncludeVisualViewportTransform) const;
- bool effect_is_isolated_by_layer(EffectNodeIndex) const;
- bool has_unisolated_destination_reading_effect() const;
void for_each_effects_filter_image_frame_id(Function<void(u64)> const&) const;
private:
diff --git a/Libraries/LibCompositing/Rust/src/ffi.rs b/Libraries/LibCompositing/Rust/src/ffi.rs
index 918204c922f..cc7e77a387a 100644
--- a/Libraries/LibCompositing/Rust/src/ffi.rs
+++ b/Libraries/LibCompositing/Rust/src/ffi.rs
@@ -548,55 +548,6 @@ pub unsafe extern "C" fn visual_context_tree_sampled_background_color(
true
}
-/// # Safety
-///
-/// `tree` must be a live retained tree handle and `out_opacity` must be writable. Returns whether
-/// `effect` names an effects node.
-#[unsafe(no_mangle)]
-pub unsafe extern "C" fn visual_context_tree_effects_opacity(
- tree: *const c_void,
- effect: EffectNodeIndex,
- out_opacity: *mut f32,
-) -> bool {
- match unsafe { tree_from_handle(tree) }.effects_opacity(effect) {
- Some(opacity) => {
- // SAFETY: The caller guarantees `out_opacity` is writable.
- unsafe { *out_opacity = opacity };
- true
- }
- None => false,
- }
-}
-
-/// # Safety
-///
-/// `tree` must be a live retained tree handle; `roots` must address `root_count` spatial indices and
-/// `out_flags` must address one writable flag per spatial node (`flag_count` of them).
-#[unsafe(no_mangle)]
-pub unsafe extern "C" fn visual_context_tree_mark_spatial_subtrees(
- tree: *const c_void,
- roots: *const SpatialNodeIndex,
- root_count: usize,
- out_flags: *mut bool,
- flag_count: usize,
-) {
- let tree = unsafe { tree_from_handle(tree) };
- // SAFETY: The caller guarantees the roots address `root_count` indices.
- let roots = unsafe { ak::slice_from_raw_parts(roots, root_count) };
- let in_subtree = tree.spatial_nodes_in_subtrees_of(roots);
- assert_eq!(in_subtree.len(), flag_count);
- // SAFETY: The caller guarantees `out_flags` addresses `flag_count` writable flags.
- unsafe { std::ptr::copy_nonoverlapping(in_subtree.as_ptr(), out_flags, flag_count) };
-}
-
-/// # Safety
-///
-/// `tree` must be a live retained tree handle.
-#[unsafe(no_mangle)]
-pub unsafe extern "C" fn visual_context_tree_has_unisolated_destination_reading_effect(tree: *const c_void) -> bool {
- unsafe { tree_from_handle(tree) }.has_unisolated_destination_reading_effect()
-}
-
/// # Safety
///
/// `tree` must be a live retained tree handle; `visit` is called synchronously with `context` for the id
@@ -623,17 +574,6 @@ pub unsafe extern "C" fn visual_context_tree_for_each_effects_filter_image_frame
}
}
-/// # Safety
-///
-/// `tree` must be a live retained tree handle.
-#[unsafe(no_mangle)]
-pub unsafe extern "C" fn visual_context_tree_effect_is_isolated_by_layer(
- tree: *const c_void,
- effect: EffectNodeIndex,
-) -> bool {
- unsafe { tree_from_handle(tree) }.effect_is_isolated_by_layer(effect)
-}
-
/// # Safety
///
/// Returns a builder handle for hand-built test trees rooted at an identity visual viewport