Coalesce resize layout diagnostics
This commit is contained in:
1 parent
480f0bc99f
commit
82fa6c1123
7 files changed
+316
-28
No files matched your search
@@ -111,6 +111,8 @@ impl<'a> Painter<'a> {
|
||||
#[cfg(feature = "layout-diagnostics")]
|
||||
diag::bump(Counter::PlaceCalls);
|
||||
let region = region.within(&self.region);
|
||||
#[cfg(feature = "layout-diagnostics")]
|
||||
diag::placed(id.id(), self.id, region);
|
||||
self.widget_at(id, region, true)
|
||||
}
|
||||
|
||||
@@ -150,6 +152,8 @@ impl<'a> Painter<'a> {
|
||||
.widgets()
|
||||
.get_dyn(id.id())
|
||||
.and_then(|widget| widget.size_hint(axis));
|
||||
#[cfg(feature = "layout-diagnostics")]
|
||||
diag::hint_read(id.id(), self.id, axis, hint);
|
||||
match hint {
|
||||
Some(hint) => {
|
||||
#[cfg(feature = "layout-diagnostics")]
|
||||
@@ -262,7 +266,10 @@ pub struct DrawResult<'p, 'a, W: ?Sized> {
|
||||
impl<W: ?Sized> DrawResult<'_, '_, W> {
|
||||
pub fn size(self) -> Size {
|
||||
#[cfg(feature = "layout-diagnostics")]
|
||||
diag::bump(Counter::SizeReads);
|
||||
{
|
||||
diag::bump(Counter::SizeReads);
|
||||
diag::size_read(self.child.id(), self.painter.id, self.size);
|
||||
}
|
||||
self.painter.depend_on_size(self.child);
|
||||
self.size
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user