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 322694 c6c5eee7d566b40a6efce047ab0630819916f93d
parent 322693 8991ec245323d9d4442f864dd8fd819a45abade4
child 322695 27b29b39a393042a54af3e6594a7ae5e1a06a044
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersnjn
bugs1317430
milestone53.0a1
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;