Skip to content

Commit

Permalink
Backed out 7 changesets (bug 1510490) for Btup bustages CLOSED TREE
Browse files Browse the repository at this point in the history
Backed out changeset f9d8e4ebe0a2 (bug 1510490)
Backed out changeset 55fa8c9b0c7e (bug 1510490)
Backed out changeset ee215fdef53f (bug 1510490)
Backed out changeset c02d08e9dd38 (bug 1510490)
Backed out changeset 6fafd118a82a (bug 1510490)
Backed out changeset 094544e620e1 (bug 1510490)
Backed out changeset 96e1ddc0637b (bug 1510490)
  • Loading branch information
shindli committed Dec 1, 2018
1 parent 101c3df commit 675011e
Show file tree
Hide file tree
Showing 15 changed files with 351 additions and 558 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion gfx/thebes/gfxPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ WebRenderMemoryReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
helper.Report(aReport.images, "resource-cache/images");
helper.Report(aReport.rasterized_blobs,
"resource-cache/rasterized-blobs");
helper.Report(aReport.shader_cache, "shader-cache");

// GPU Memory.
helper.ReportTexture(aReport.gpu_cache_textures, "gpu-cache");
Expand All @@ -714,6 +713,9 @@ WebRenderMemoryReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
helper.ReportTexture(aReport.depth_target_textures, "depth-targets");
helper.ReportTexture(aReport.swap_chain, "swap-chains");

// Total GPU bytes, for sanity-checking the above.
helper.ReportTotalGPUBytes(aReport.total_gpu_bytes_allocated);

FinishAsyncMemoryReport();
},
[](mozilla::ipc::ResponseRejectReason aReason) {
Expand Down
12 changes: 3 additions & 9 deletions gfx/webrender_bindings/RenderThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ using namespace mozilla;

static already_AddRefed<gl::GLContext> CreateGLContext();

MOZ_DEFINE_MALLOC_SIZE_OF(WebRenderRendererMallocSizeOf)

namespace mozilla {
namespace wr {

Expand Down Expand Up @@ -130,18 +128,14 @@ void RenderThread::DoAccumulateMemoryReport(
MemoryReport aReport,
const RefPtr<MemoryReportPromise::Private>& aPromise) {
MOZ_ASSERT(IsInRenderThread());
MOZ_ASSERT(aReport.total_gpu_bytes_allocated == 0);

for (auto& r : mRenderers) {
r.second->AccumulateMemoryReport(&aReport);
}

// Note memory used by the shader cache, which is shared across all WR
// instances.
MOZ_ASSERT(aReport.shader_cache == 0);
if (mProgramCache) {
aReport.shader_cache = wr_program_cache_report_memory(
mProgramCache->Raw(), &WebRenderRendererMallocSizeOf);
}
// Note total gpu bytes allocated across all WR instances.
aReport.total_gpu_bytes_allocated += wr_total_gpu_bytes_allocated();

aPromise->Resolve(aReport, __func__);
}
Expand Down
1 change: 1 addition & 0 deletions gfx/webrender_bindings/RendererOGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ void RendererOGL::AccumulateMemoryReport(MemoryReport* aReport) {
BytesPerPixel(SurfaceFormat::B8G8R8A8) *
(mCompositor->UseTripleBuffering() ? 3 : 2);
aReport->swap_chain += swapChainSize;
aReport->total_gpu_bytes_allocated += swapChainSize;
}

static void DoNotifyWebRenderError(layers::CompositorBridgeParent* aBridge,
Expand Down
13 changes: 5 additions & 8 deletions gfx/webrender_bindings/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,11 @@ pub unsafe extern "C" fn wr_renderer_accumulate_memory_report(renderer: &mut Ren
*report += renderer.report_memory();
}

#[no_mangle]
pub unsafe extern "C" fn wr_total_gpu_bytes_allocated() -> usize {
::webrender::total_gpu_bytes_allocated()
}

// cbindgen doesn't support tuples, so we have a little struct instead, with
// an Into implementation to convert from the tuple to the struct.
#[repr(C)]
Expand Down Expand Up @@ -2794,11 +2799,3 @@ pub unsafe extern "C" fn wr_shaders_delete(shaders: *mut WrShaders, gl_context:
}
// let shaders go out of scope and get dropped
}

#[no_mangle]
pub unsafe extern "C" fn wr_program_cache_report_memory(
cache: *const WrProgramCache,
size_of_op: VoidPtrToSizeFn,
) -> usize {
(*cache).program_cache.report_memory(size_of_op)
}
Loading

0 comments on commit 675011e

Please sign in to comment.