Bug 746913 - Plugins NativeRenderer X/qt/gtk includes defines cleanup. r=karlt, a=desktop-only
authorOleg Romashin <romaxa@gmail.com>
Fri, 20 Apr 2012 17:15:59 -0400
changeset 95364 230435e1426324b472d3d1a8aed32845b788178b
parent 95363 a12cbe3bf0456b062226487199ec6615c8b06ff3
child 95365 d7d1e8e3b435a1e3681b18b80d08c3cb3d1877b9
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, desktop-only
bugs746913
milestone14.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 746913 - Plugins NativeRenderer X/qt/gtk includes defines cleanup. r=karlt, a=desktop-only
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginInstanceOwner.h
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -115,17 +115,16 @@ static NS_DEFINE_CID(kAppShellCID, NS_AP
 #include <Carbon/Carbon.h>
 #include "nsPluginUtilsOSX.h"
 #endif
 
 #ifdef MOZ_WIDGET_GTK2
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
-#include "gfxXlibNativeRenderer.h"
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "ANPBase.h"
 #include "AndroidBridge.h"
 #include "AndroidMediaLayer.h"
 using namespace mozilla::dom;
 
@@ -3036,18 +3035,17 @@ void nsPluginInstanceOwner::Paint(gfxCon
 
   Renderer renderer(window, this, pluginSize, pluginDirtyRect);
 #ifdef MOZ_WIDGET_GTK2
   // This is the visual used by the widgets, 24-bit if available.
   GdkVisual* gdkVisual = gdk_rgb_get_visual();
   Visual* visual = gdk_x11_visual_get_xvisual(gdkVisual);
   Screen* screen =
     gdk_x11_screen_get_xscreen(gdk_visual_get_screen(gdkVisual));
-#endif
-#ifdef MOZ_WIDGET_QT
+#else
   Display* dpy = mozilla::DefaultXDisplay();
   Screen* screen = DefaultScreenOfDisplay(dpy);
   Visual* visual = DefaultVisualOfScreen(screen);
 #endif
   renderer.Draw(aContext, nsIntSize(window->width, window->height),
                 rendererFlags, screen, visual, nsnull);
 }
 nsresult
--- a/dom/plugins/base/nsPluginInstanceOwner.h
+++ b/dom/plugins/base/nsPluginInstanceOwner.h
@@ -71,26 +71,21 @@
 class nsIInputStream;
 struct nsIntRect;
 class nsPluginDOMContextMenuListener;
 class nsObjectFrame;
 class nsDisplayListBuilder;
 
 #ifdef MOZ_X11
 class gfxXlibSurface;
-#endif
-
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_QT
+#include "gfxQtNativeRenderer.h"
+#else
 #include "gfxXlibNativeRenderer.h"
 #endif
-
-#ifdef MOZ_WIDGET_QT
-#ifdef MOZ_X11
-#include "gfxQtNativeRenderer.h"
-#endif
 #endif
 
 #ifdef XP_OS2
 #define INCL_PM
 #define INCL_GPI
 #include <os2.h>
 #endif
 
@@ -405,20 +400,20 @@ private:
   nsresult DispatchKeyToPlugin(nsIDOMEvent* aKeyEvent);
   nsresult DispatchMouseToPlugin(nsIDOMEvent* aMouseEvent);
   nsresult DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent);
   
   nsresult EnsureCachedAttrParamArrays();
   
 #ifdef MOZ_X11
   class Renderer
-#if defined(MOZ_WIDGET_GTK2)
+#if defined(MOZ_WIDGET_QT)
+  : public gfxQtNativeRenderer
+#else
   : public gfxXlibNativeRenderer
-#elif defined(MOZ_WIDGET_QT)
-  : public gfxQtNativeRenderer
 #endif
   {
   public:
     Renderer(NPWindow* aWindow, nsPluginInstanceOwner* aInstanceOwner,
              const nsIntSize& aPluginSize, const nsIntRect& aDirtyRect)
     : mWindow(aWindow), mInstanceOwner(aInstanceOwner),
     mPluginSize(aPluginSize), mDirtyRect(aDirtyRect)
     {}