Bug 1521686 - Get rid of unused EnsureSharedSurfaceSize() method r=jmathies
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 25 Jan 2019 22:18:28 +0000
changeset 455529 bdf350144ce46d0e5ab7974ca365a034bec09457
parent 455528 0f8a67bf322646794f0b47427f0b74b289f4a2a7
child 455530 3883a443b7f893bb8424c8a57ba376bbd1d3d275
push id76841
push usermasayuki@d-toybox.com
push dateSat, 26 Jan 2019 00:21:25 +0000
treeherderautoland@bdf350144ce4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmathies
bugs1521686, 506926
milestone66.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 1521686 - Get rid of unused EnsureSharedSurfaceSize() method r=jmathies The method was added by bug 506926, but not sure when this becomes an orphan. Differential Revision: https://phabricator.services.mozilla.com/D17215
widget/windows/nsWindowGfx.cpp
--- a/widget/windows/nsWindowGfx.cpp
+++ b/widget/windows/nsWindowGfx.cpp
@@ -118,37 +118,16 @@ LayoutDeviceIntRegion nsWindow::GetRegio
     }
     LayoutDeviceIntRegion rgn(WinUtils::ConvertHRGNToRegion(paintRgn));
     ::DeleteObject(paintRgn);
     return rgn;
   }
   return LayoutDeviceIntRegion(WinUtils::ToIntRect(ps.rcPaint));
 }
 
-#define WORDSSIZE(x) ((x).width * (x).height)
-static bool EnsureSharedSurfaceSize(IntSize size) {
-  IntSize screenSize;
-  screenSize.height = GetSystemMetrics(SM_CYSCREEN);
-  screenSize.width = GetSystemMetrics(SM_CXSCREEN);
-
-  if (WORDSSIZE(screenSize) > WORDSSIZE(size)) size = screenSize;
-
-  if (WORDSSIZE(screenSize) < WORDSSIZE(size))
-    NS_WARNING("Trying to create a shared surface larger than the screen");
-
-  if (!sSharedSurfaceData ||
-      (WORDSSIZE(size) > WORDSSIZE(sSharedSurfaceSize))) {
-    sSharedSurfaceSize = size;
-    sSharedSurfaceData =
-        MakeUniqueFallible<uint8_t[]>(WORDSSIZE(sSharedSurfaceSize) * 4);
-  }
-
-  return !sSharedSurfaceData;
-}
-
 nsIWidgetListener* nsWindow::GetPaintListener() {
   if (mDestroyCalled) return nullptr;
   return mAttachedWidgetListener ? mAttachedWidgetListener : mWidgetListener;
 }
 
 void nsWindow::ForcePresent() {
   if (mResizeState != RESIZING) {
     if (CompositorBridgeChild* remoteRenderer = GetRemoteRenderer()) {