Bug 1317430 - Avoid a unnecessary copy by passing a const & in view/ r=njn
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 14 Nov 2016 23:16:52 +0100
changeset 369941 c6c5eee7d566b40a6efce047ab0630819916f93d
parent 369940 8991ec245323d9d4442f864dd8fd819a45abade4
child 369942 27b29b39a393042a54af3e6594a7ae5e1a06a044
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1317430
milestone53.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 1317430 - Avoid a unnecessary copy by passing a const & in view/ r=njn MozReview-Commit-ID: BAZITOmUMVg
view/nsViewManager.cpp
view/nsViewManager.h
--- a/view/nsViewManager.cpp
+++ b/view/nsViewManager.cpp
@@ -727,17 +727,17 @@ void nsViewManager::WillPaintWindow(nsIW
 
   nsCOMPtr<nsIPresShell> shell = mPresShell;
   if (shell) {
     shell->WillPaintWindow();
   }
 }
 
 bool nsViewManager::PaintWindow(nsIWidget* aWidget,
-                                LayoutDeviceIntRegion aRegion)
+                                const LayoutDeviceIntRegion& aRegion)
 {
   if (!aWidget || !mContext)
     return false;
 
   NS_ASSERTION(IsPaintingAllowed(),
                "shouldn't be receiving paint events while painting is disallowed!");
 
   // Get the view pointer here since NS_WILL_PAINT might have
--- a/view/nsViewManager.h
+++ b/view/nsViewManager.h
@@ -378,17 +378,17 @@ private:
   bool IsRootVM() const { return this == RootViewManager(); }
 
   // Whether synchronous painting is allowed at the moment. For example,
   // widget geometry changes can cause synchronous painting, so they need to
   // be deferred while refresh is disabled.
   bool IsPaintingAllowed() { return RootViewManager()->mRefreshDisableCount == 0; }
 
   void WillPaintWindow(nsIWidget* aWidget);
-  bool PaintWindow(nsIWidget* aWidget, LayoutDeviceIntRegion aRegion);
+  bool PaintWindow(nsIWidget* aWidget, const LayoutDeviceIntRegion& aRegion);
   void DidPaintWindow();
 
   // Call this when you need to let the viewmanager know that it now has
   // pending updates.
   void PostPendingUpdate();
 
   RefPtr<nsDeviceContext> mContext;
   nsIPresShell   *mPresShell;