Bug 1504115 - Missing bits from landed patch. r=gw
authorBobby Holley <bobbyholley@gmail.com>
Tue, 30 Oct 2018 15:13:32 -0700
changeset 445319 983a36d284847bd63a817c0fca1153306ad879d1
parent 445318 fb1241ca988c7bfe1ef4a8ec1f17e434d58194e4
child 445320 3b764f11b98032806138a3baf8e5878a062aadfa
push id35014
push userdvarga@mozilla.com
push dateFri, 09 Nov 2018 10:01:40 +0000
treeherdermozilla-central@5e7636ec12c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgw
bugs1504115
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1504115 - Missing bits from landed patch. r=gw Somehow the mc patch lost the changes in webrending_bindings when it landed.
gfx/webrender_bindings/RenderThread.cpp
gfx/webrender_bindings/src/bindings.rs
gfx/webrender_bindings/webrender_ffi_generated.h
--- a/gfx/webrender_bindings/RenderThread.cpp
+++ b/gfx/webrender_bindings/RenderThread.cpp
@@ -146,16 +146,20 @@ RenderThread::IsInRenderThread()
 void
 RenderThread::DoAccumulateMemoryReport(MemoryReport aReport, const RefPtr<MemoryReportPromise::Private>& aPromise)
 {
   MOZ_ASSERT(IsInRenderThread());
   for (auto& r: mRenderers) {
     wr_renderer_accumulate_memory_report(r.second->GetRenderer(), &aReport);
   }
 
+  // Note total gpu bytes allocated across all WR instances.
+  MOZ_ASSERT(aReport.total_gpu_bytes_allocated == 0);
+  aReport.total_gpu_bytes_allocated = wr_total_gpu_bytes_allocated();
+
   aPromise->Resolve(aReport, __func__);
 }
 
 // static
 RefPtr<MemoryReportPromise>
 RenderThread::AccumulateMemoryReport(MemoryReport aInitial)
 {
   RefPtr<MemoryReportPromise::Private> p = new MemoryReportPromise::Private(__func__);
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -675,16 +675,21 @@ pub unsafe extern "C" fn wr_renderer_del
 }
 
 #[no_mangle]
 pub unsafe extern "C" fn wr_renderer_accumulate_memory_report(renderer: &mut Renderer,
                                                               report: &mut MemoryReport) {
     *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)]
 pub struct WrPipelineEpoch {
     pipeline_id: WrPipelineId,
     epoch: WrEpoch,
 }
 
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -1800,16 +1800,20 @@ WR_INLINE
 void wr_thread_pool_delete(WrThreadPool *aThreadPool)
 WR_DESTRUCTOR_SAFE_FUNC;
 
 WR_INLINE
 WrThreadPool *wr_thread_pool_new()
 WR_FUNC;
 
 WR_INLINE
+uintptr_t wr_total_gpu_bytes_allocated()
+WR_FUNC;
+
+WR_INLINE
 void wr_transaction_append_transform_properties(Transaction *aTxn,
                                                 const WrTransformProperty *aTransformArray,
                                                 uintptr_t aTransformCount)
 WR_FUNC;
 
 WR_INLINE
 void wr_transaction_clear_display_list(Transaction *aTxn,
                                        WrEpoch aEpoch,