Backed out changeset a373ca9138d7 (bug 1690956) for causing mochitest crashes in ReportMemory.

CLOSED TREE
This commit is contained in:
Alexandru Michis 2021-04-06 08:08:07 +03:00
Родитель 27ca0cb3ee
Коммит ee9dab6aa9
6 изменённых файлов: 2 добавлений и 25 удалений

Просмотреть файл

@ -755,7 +755,6 @@ WebRenderMemoryReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
"texture-cache/structures");
helper.Report(aReport.shader_cache, "shader-cache");
helper.Report(aReport.display_list, "display-list");
helper.Report(aReport.swgl, "swgl");
helper.Report(aReport.upload_staging_memory, "upload-stagin-memory");
WEBRENDER_FOR_EACH_INTERNER(REPORT_INTERNER);

Просмотреть файл

@ -2788,13 +2788,4 @@ void DestroyContext(Context* c) {
delete c;
}
size_t ReportMemory(size_t (*size_of_op)(void*)) {
size_t size = 0;
for (auto& t : ctx->textures) {
if (t && t->buf) {
size += size_of_op(t->buf);
}
}
return size;
}
} // extern "C"

Просмотреть файл

@ -316,7 +316,6 @@ extern "C" {
fn ReferenceContext(ctx: *mut c_void);
fn DestroyContext(ctx: *mut c_void);
fn MakeCurrent(ctx: *mut c_void);
fn ReportMemory(size_of_op: unsafe extern "C" fn(ptr: *const c_void) -> usize) -> usize;
}
#[derive(Clone, Copy)]
@ -450,10 +449,6 @@ impl Context {
}
}
}
pub fn report_memory(size_of_op: unsafe extern "C" fn(ptr: *const c_void) -> usize) -> usize {
unsafe { ReportMemory(size_of_op) }
}
}
impl From<*mut c_void> for Context {

Просмотреть файл

@ -39,7 +39,6 @@ use webrender_build::shader::{
ProgramSourceDigest, ShaderKind, ShaderVersion, build_shader_main_string,
build_shader_prefix_string, do_build_shader_string, shader_source_from_file,
};
use malloc_size_of::MallocSizeOfOps;
/// Sequence number for frames, as tracked by the device layer.
#[derive(Debug, Copy, Clone, PartialEq, Ord, Eq, PartialOrd)]
@ -3913,17 +3912,11 @@ impl Device {
}
/// Generates a memory report for the resources managed by the device layer.
pub fn report_memory(&self, size_op_funs: &MallocSizeOfOps) -> MemoryReport {
pub fn report_memory(&self) -> MemoryReport {
let mut report = MemoryReport::default();
for dim in self.depth_targets.keys() {
report.depth_target_textures += depth_target_size_in_bytes(dim);
}
#[cfg(feature = "sw_compositor")]
{
report.swgl += swgl::Context::report_memory(size_op_funs.size_of_op);
}
// unconditionally use size_op_funs
let _ = size_op_funs;
report
}
}

Просмотреть файл

@ -1435,7 +1435,6 @@ pub struct MemoryReport {
pub interning: InterningMemoryReport,
pub display_list: usize,
pub upload_staging_memory: usize,
pub swgl: usize,
//
// GPU memory.

Просмотреть файл

@ -5287,7 +5287,7 @@ impl Renderer {
report += self.texture_upload_pbo_pool.report_memory();
// Textures held internally within the device layer.
report += self.device.report_memory(self.size_of_ops.as_ref().unwrap());
report += self.device.report_memory();
report
}