pub struct CpuHitTester { /* private fields */ }Expand description
CPU-based hit tester that works without WebRender.
In the GPU path, hit testing is done by AsyncHitTester which queries
WebRender’s spatial tree. In headless mode, we do hit testing directly
against the layout results (positioned rectangles).
This is actually simpler and faster than the WebRender path, since we don’t need to go through the compositor’s spatial tree — we just walk the layout result nodes and check point-in-rect.
Implementations§
Source§impl CpuHitTester
impl CpuHitTester
Sourcepub fn node_rects_total(&self) -> usize
pub fn node_rects_total(&self) -> usize
Sum of HitTestEntry counts across all DomIds (for leak probes).
Sourcepub fn rebuild_from_layout(
&mut self,
layout_results: &BTreeMap<DomId, DomLayoutResult>,
)
pub fn rebuild_from_layout( &mut self, layout_results: &BTreeMap<DomId, DomLayoutResult>, )
Rebuild the hit test structure from layout results.
Called after each layout pass. Extracts positioned rectangles from
LayoutWindow::layout_results and builds a flat list for fast
point-in-rect testing.
Auto Trait Implementations§
impl Freeze for CpuHitTester
impl RefUnwindSafe for CpuHitTester
impl Send for CpuHitTester
impl Sync for CpuHitTester
impl Unpin for CpuHitTester
impl UnsafeUnpin for CpuHitTester
impl UnwindSafe for CpuHitTester
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more