fonts: Add MallocSizeOf implementation for FontContext (#32206)

* fonts: Add `MallocSizeOf` implementation for `FontContext`

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* android: remove unused imports in font_list.rs

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Martin Robinson 2024-05-03 11:54:29 +02:00 committed by GitHub
parent 160c7c0b0f
commit 1c9120c293
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 119 additions and 25 deletions

View file

@ -425,7 +425,7 @@ impl Layout for LayoutThread {
// malloc_enclosing_size_of function.
let mut ops = MallocSizeOfOps::new(servo_allocator::usable_size, None, None);
// FIXME(njn): Just measuring the display tree for now.
// TODO: Measure more than just display list, stylist, and font context.
let formatted_url = &format!("url({})", self.url);
reports.push(Report {
path: path![formatted_url, "layout-thread", "display-list"],
@ -438,6 +438,12 @@ impl Layout for LayoutThread {
kind: ReportKind::ExplicitJemallocHeapSize,
size: self.stylist.size_of(&mut ops),
});
reports.push(Report {
path: path![formatted_url, "layout-thread", "font-context"],
kind: ReportKind::ExplicitJemallocHeapSize,
size: self.font_context.size_of(&mut ops),
});
}
fn set_quirks_mode(&mut self, quirks_mode: QuirksMode) {