Bug 1436190: Fixed render frame notification in wake_up(). r=nical
authorDzmitry Malyshau <kvark@mozilla.com>
Thu, 08 Feb 2018 10:49:25 -0500
changeset 402966 2c590c7dac39d35e63910d0faebb879900a57b1b
parent 402965 ef6f210e84821e7c7573eba0ebd575e901857452
child 402967 c20c8479be29d195360a929939123d74ee933e95
push id33407
push usercbrindusan@mozilla.com
push dateThu, 08 Feb 2018 19:02:31 +0000
treeherdermozilla-central@c5120bcaf7bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1436190
milestone60.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 1436190: Fixed render frame notification in wake_up(). r=nical MozReview-Commit-ID: JHBKpAh4YDD
gfx/webrender_bindings/RenderThread.cpp
gfx/webrender_bindings/WebRenderAPI.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
@@ -458,16 +458,22 @@ WebRenderProgramCache::~WebRenderProgram
 extern "C" {
 
 static void NewFrameReady(mozilla::wr::WrWindowId aWindowId)
 {
   mozilla::wr::RenderThread::Get()->IncRenderingFrameCount(aWindowId);
   mozilla::wr::RenderThread::Get()->NewFrameReady(mozilla::wr::WindowId(aWindowId));
 }
 
+void wr_notifier_wake_up(mozilla::wr::WrWindowId aWindowId)
+{
+  //TODO?
+  mozilla::Unused << aWindowId;
+}
+
 void wr_notifier_new_frame_ready(mozilla::wr::WrWindowId aWindowId)
 {
   NewFrameReady(aWindowId);
 }
 
 void wr_notifier_new_scroll_frame_ready(mozilla::wr::WrWindowId aWindowId, bool aCompositeNeeded)
 {
   // If we sent a transaction that contained both scrolling updates and a
--- a/gfx/webrender_bindings/WebRenderAPI.cpp
+++ b/gfx/webrender_bindings/WebRenderAPI.cpp
@@ -534,17 +534,16 @@ WebRenderAPI::WaitFlushed()
 void
 WebRenderAPI::Capture()
 {
   uint8_t bits = 3; //TODO: get from JavaScript
   const char* path = "wr-capture"; //TODO: get from JavaScript
   const char* border = "--------------------------\n";
   printf("%s Capturing WR state to: %s\n%s", border, path, border);
   wr_api_capture(mDocHandle, path, bits);
-  RenderThread::Get()->IncPendingFrameCount(GetId());
 }
 
 
 void
 TransactionBuilder::Clear()
 {
   wr_resource_updates_clear(mResourceUpdates);
 }
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -449,33 +449,34 @@ extern "C" {
 
 struct CppNotifier {
     window_id: WrWindowId,
 }
 
 unsafe impl Send for CppNotifier {}
 
 extern "C" {
+    fn wr_notifier_wake_up(window_id: WrWindowId);
     fn wr_notifier_new_frame_ready(window_id: WrWindowId);
     fn wr_notifier_new_scroll_frame_ready(window_id: WrWindowId,
                                           composite_needed: bool);
     fn wr_notifier_external_event(window_id: WrWindowId,
                                   raw_event: usize);
 }
 
 impl RenderNotifier for CppNotifier {
     fn clone(&self) -> Box<RenderNotifier> {
         Box::new(CppNotifier {
             window_id: self.window_id,
         })
     }
 
     fn wake_up(&self) {
         unsafe {
-            wr_notifier_new_frame_ready(self.window_id);
+            wr_notifier_wake_up(self.window_id);
         }
     }
 
     fn new_document_ready(&self,
                           _: DocumentId,
                           scrolled: bool,
                           composite_needed: bool) {
         unsafe {
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -1351,16 +1351,18 @@ extern bool wr_moz2d_render_cb(ByteSlice
 extern void wr_notifier_external_event(WrWindowId aWindowId,
                                        size_t aRawEvent);
 
 extern void wr_notifier_new_frame_ready(WrWindowId aWindowId);
 
 extern void wr_notifier_new_scroll_frame_ready(WrWindowId aWindowId,
                                                bool aCompositeNeeded);
 
+extern void wr_notifier_wake_up(WrWindowId aWindowId);
+
 WR_INLINE
 void wr_program_cache_delete(WrProgramCache *aProgramCache)
 WR_DESTRUCTOR_SAFE_FUNC;
 
 WR_INLINE
 WrProgramCache *wr_program_cache_new()
 WR_FUNC;