mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
Add scroll tree measurement in IOCompositor (#38922)
Adds a new memory report that aggregates the size of all scroll trees from within all pipelines for each web view. Testing: Acessing `about:memory` Fixes: #38726 --------- Signed-off-by: criskell <96352451+criskell@users.noreply.github.com>
This commit is contained in:
parent
55be274777
commit
7339e2b421
5 changed files with 38 additions and 3 deletions
|
@ -22,6 +22,7 @@ use embedder_traits::{
|
|||
use euclid::{Point2D, Scale, Vector2D};
|
||||
use fnv::FnvHashSet;
|
||||
use log::{debug, warn};
|
||||
use malloc_size_of::MallocSizeOf;
|
||||
use servo_geometry::DeviceIndependentPixel;
|
||||
use style_traits::{CSSPixel, PinchZoomFactor};
|
||||
use webrender_api::units::{DeviceIntPoint, DevicePixel, DevicePoint, DeviceRect, LayoutVector2D};
|
||||
|
@ -1001,6 +1002,16 @@ impl WebViewRenderer {
|
|||
));
|
||||
self.viewport_description = Some(viewport_description);
|
||||
}
|
||||
|
||||
pub(crate) fn scroll_trees_memory_usage(
|
||||
&self,
|
||||
ops: &mut malloc_size_of::MallocSizeOfOps,
|
||||
) -> usize {
|
||||
self.pipelines
|
||||
.values()
|
||||
.map(|pipeline| pipeline.scroll_tree.size_of(ops))
|
||||
.sum::<usize>()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue