Bug 959281 - http://paperjs.org/examples/voronoi/ drawing performance has regressed badly. r=spohl a=lsblakk
authorSteven Michaud <smichaud@pobox.com>
Thu, 17 Apr 2014 12:58:38 -0500
changeset 192920 b950396b254f4cfa7a29a1b11ff6e3c973ffdd44
parent 192919 6cbb310b373b104224a803485c59ebfbf22d4051
child 192921 0f85c1a7a5ca79b6acca12cc8c49bd5f73249f39
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl, lsblakk
bugs959281
milestone30.0a2
Bug 959281 - http://paperjs.org/examples/voronoi/ drawing performance has regressed badly. r=spohl a=lsblakk
widget/cocoa/nsAppShell.mm
--- a/widget/cocoa/nsAppShell.mm
+++ b/widget/cocoa/nsAppShell.mm
@@ -612,17 +612,21 @@ nsAppShell::ProcessNextNativeEvent(bool 
     if (aMayWait) {
       mozilla::HangMonitor::Suspend();
     }
 
     // If we're running modal (or not in a Gecko "main" event loop) we still
     // need to use nextEventMatchingMask and sendEvent -- otherwise (in
     // Minefield) the modal window (or non-main event loop) won't receive key
     // events or most mouse events.
-    if ([NSApp _isRunningModal] || !InGeckoMainEventLoop()) {
+    //
+    // Add aMayWait to minimize the number of calls to -[NSApp sendEvent:]
+    // made from nsAppShell::ProcessNextNativeEvent() (and indirectly from
+    // nsBaseAppShell::OnProcessNextEvent()), to work around bug 959281.
+    if ([NSApp _isRunningModal] || (aMayWait && !InGeckoMainEventLoop())) {
       if ((nextEvent = [NSApp nextEventMatchingMask:NSAnyEventMask
                                           untilDate:waitUntil
                                              inMode:currentMode
                                             dequeue:YES])) {
         // If we're in a Cocoa app-modal session that's been interrupted by a
         // Gecko-modal dialog, send the event to the Cocoa app-modal dialog's
         // session.  This ensures that the app-modal session won't be starved
         // of events, and fixes bugs 463473 and 442442.  (The case of an