Bug 1304637 - Move back to using window display for basic composition paths. r=lsalzman
authorRyan Hunt <ryanhunt@outlook.com>
Thu, 27 Oct 2016 14:39:59 -0400
changeset 319848 20ff6628ea8befe4843e8ea2f73f8782193a121e
parent 319847 0349a81229e75a5c4f296d0cd52eb4b62c49c2d2
child 319849 378639d730e476941e68d69ee7157a253b54879c
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1304637
milestone52.0a1
Bug 1304637 - Move back to using window display for basic composition paths. r=lsalzman MozReview-Commit-ID: CutLou4qJi
widget/gtk/X11CompositorWidget.cpp
widget/gtk/nsWindow.cpp
widget/gtk/nsWindow.h
--- a/widget/gtk/X11CompositorWidget.cpp
+++ b/widget/gtk/X11CompositorWidget.cpp
@@ -16,17 +16,17 @@ namespace widget {
 
 X11CompositorWidget::X11CompositorWidget(const CompositorWidgetInitData& aInitData,
                                          nsWindow* aWindow)
       : mWidget(aWindow)
 {
   // If we have a nsWindow, then grab the already existing display connection
   // If we don't, then use the init data to connect to the display
   if (aWindow) {
-    mXDisplay = (Display*)aWindow->GetNativeData(NS_NATIVE_COMPOSITOR_DISPLAY);
+    mXDisplay = aWindow->XDisplay();
   } else {
     mXDisplay = XOpenDisplay(aInitData.XDisplayString().get());
   }
   mXWindow = (Window)aInitData.XWindow();
 
   // Grab the window's visual and depth
   XWindowAttributes windowAttrs;
   XGetWindowAttributes(mXDisplay, mXWindow, &windowAttrs);
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -7018,17 +7018,14 @@ int32_t
 nsWindow::RoundsWidgetCoordinatesTo()
 {
     return GdkScaleFactor();
 }
 
 void nsWindow::GetCompositorWidgetInitData(mozilla::widget::CompositorWidgetInitData* aInitData)
 {
   #ifdef MOZ_X11
-  Display* xDisplay = (Display*)GetNativeData(NS_NATIVE_COMPOSITOR_DISPLAY);
-  char* xDisplayString = XDisplayString(xDisplay);
-
   *aInitData = mozilla::widget::CompositorWidgetInitData(
                                   mXWindow,
-                                  nsCString(xDisplayString),
+                                  nsCString(XDisplayString(mXDisplay)),
                                   GetClientSize());
   #endif
 }
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -341,16 +341,19 @@ public:
     virtual nsresult SynthesizeNativeTouchPoint(uint32_t aPointerId,
                                                 TouchPointerState aPointerState,
                                                 LayoutDeviceIntPoint aPoint,
                                                 double aPointerPressure,
                                                 uint32_t aPointerOrientation,
                                                 nsIObserver* aObserver) override;
 #endif
 
+#ifdef MOZ_X11
+    Display* XDisplay() { return mXDisplay; }
+#endif
     virtual void GetCompositorWidgetInitData(mozilla::widget::CompositorWidgetInitData* aInitData) override;
 
     // HiDPI scale conversion
     gint GdkScaleFactor();
 
     // To GDK
     gint DevicePixelsToGdkCoordRoundUp(int pixels);
     gint DevicePixelsToGdkCoordRoundDown(int pixels);