Bug 710958 - Remove gfx{Glitz,DirectFB,QuartzPDF}Surface. r=joedrew.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 18 Dec 2011 14:54:50 -0800
changeset 83708 9ca7f53b97753c65d0394862eeaad7c22d66ba8e
parent 83707 8fba04927c44b914d46ce8cb046a6b8dc5e43e36
child 83709 6840cbb0b4cfd332db08b53dfaff646248dbae4b
push id21784
push usermak77@bonardo.net
push dateWed, 04 Jan 2012 12:28:24 +0000
treeherdermozilla-central@0eec6ba6a87a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjoedrew
bugs710958
milestone12.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 710958 - Remove gfx{Glitz,DirectFB,QuartzPDF}Surface. r=joedrew.
config/autoconf.mk.in
config/system-headers
configure.in
dom/plugins/ipc/PluginModuleChild.cpp
gfx/thebes/Makefile.in
gfx/thebes/cairo-gdk-utils.c
gfx/thebes/cairo-gdk-utils.h
gfx/thebes/gfxASurface.cpp
gfx/thebes/gfxASurface.h
gfx/thebes/gfxDirectFBSurface.cpp
gfx/thebes/gfxDirectFBSurface.h
gfx/thebes/gfxGdkNativeRenderer.cpp
gfx/thebes/gfxGlitzSurface.h
gfx/thebes/gfxPlatformGtk.cpp
gfx/thebes/gfxQuartzPDFSurface.cpp
gfx/thebes/gfxQuartzPDFSurface.h
js/src/config/system-headers
widget/src/gtk2/nsBidiKeyboard.cpp
widget/src/gtk2/nsScreenManagerGtk.cpp
widget/src/gtk2/nsWindow.cpp
widget/src/gtk2/nsWindow.h
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -89,17 +89,16 @@ XULRUNNER_STUB_NAME = @XULRUNNER_STUB_NA
 
 MOZ_CHROME_FILE_FORMAT	= @MOZ_CHROME_FILE_FORMAT@
 MOZ_OMNIJAR		= @MOZ_OMNIJAR@
 OMNIJAR_NAME		= @OMNIJAR_NAME@
 
 MOZ_WIDGET_TOOLKIT	= @MOZ_WIDGET_TOOLKIT@
 MOZ_GFX_OPTIMIZE_MOBILE = @MOZ_GFX_OPTIMIZE_MOBILE@
 
-MOZ_DFB			= @MOZ_DFB@
 MOZ_X11			= @MOZ_X11@
 
 MOZ_PANGO = @MOZ_PANGO@
 
 MOZ_JS_LIBS		   = @MOZ_JS_LIBS@
 
 MOZ_DEBUG	= @MOZ_DEBUG@
 MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
--- a/config/system-headers
+++ b/config/system-headers
@@ -108,21 +108,16 @@ fusion/lock.h
 fusion/types.h
 fusion/vector.h
 fusion/call.h
 fusion/shmalloc.h
 fusion/protocol.h
 fusion/fusion.h
 fusion/arena.h
 fusion/object.h
-directfbgl.h
-directfb_version.h
-directfb.h
-directfb_util.h
-directfb_keynames.h
 dgiff.h
 direct/util.h
 direct/memcpy.h
 direct/interface.h
 direct/conf.h
 direct/tree.h
 direct/signals.h
 direct/build.h
--- a/configure.in
+++ b/configure.in
@@ -4794,25 +4794,23 @@ MOZ_ARG_HEADER(Toolkit Options)
     dnl ========================================================
 	MOZ_ARG_ENABLE_STRING(default-toolkit,
 	[  --enable-default-toolkit=TK
                           Select default toolkit
                           Platform specific defaults:
                             Mac OS X - cairo-cocoa
                             OS/2 - cairo-os2
                             Win32 - cairo-windows
-                            Gtk2 with DirectFB - cairo-gtk2-dfb
                             * - cairo-gtk2
                             * - cairo-qt],
     [ _DEFAULT_TOOLKIT=$enableval ],
     [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
 
     if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
-        -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-android" \
         -o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
     then
@@ -4849,34 +4847,16 @@ cairo-gtk2|cairo-gtk2-x11)
 
     TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
     TK_LIBS='$(MOZ_GTK2_LIBS)'
     AC_DEFINE(MOZ_WIDGET_GTK2)
     MOZ_PDF_PRINTING=1
     MOZ_INSTRUMENT_EVENT_LOOP=1
     ;;
 
-cairo-gtk2-dfb)
-    MOZ_WIDGET_TOOLKIT=gtk2
-    MOZ_ENABLE_GTK2=1
-    MOZ_WEBGL=
-
-    AC_DEFINE(MOZ_DFB)
-    MOZ_DFB=1
-
-    TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
-    TK_LIBS='$(MOZ_GTK2_LIBS)'
-    AC_DEFINE(MOZ_WIDGET_GTK2)
-    if test "$no_x" != "yes"; then
-        AC_MSG_WARN([Disabling X when DirectFB is specified.])
-        no_x=yes
-    fi
-    MOZ_PDF_PRINTING=1
-    ;;
-
 cairo-qt)
     MOZ_WIDGET_TOOLKIT=qt
     MOZ_ENABLE_QT=1
     MOZ_ENABLE_XREMOTE=1
     MOZ_WEBGL=1
     MOZ_WEBGL_GLX=1
     USE_ELF_DYNSTR_GC=
 
@@ -4962,19 +4942,16 @@ fi
 if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
    AC_DEFINE(MOZ_INSTRUMENT_EVENT_LOOP)
 fi
 
 if test "$COMPILE_ENVIRONMENT"; then
   if test "$MOZ_ENABLE_GTK2"; then
     if test "$MOZ_X11"; then
       GDK_PACKAGES=gdk-x11-2.0
-    elif test "$MOZ_DFB"; then
-      PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
-      GDK_PACKAGES=directfb
     fi
 
     PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
   fi
 
 fi # COMPILE_ENVIRONMENT
 
 AC_SUBST(MOZ_FS_LAYOUT)
@@ -5122,17 +5099,16 @@ AC_SUBST(MOZ_ENABLE_XREMOTE)
 AC_SUBST(MOZ_GTK2_CFLAGS)
 AC_SUBST(MOZ_GTK2_LIBS)
 AC_SUBST(MOZ_QT_CFLAGS)
 AC_SUBST(MOZ_QT_LIBS)
 
 AC_SUBST(MOC)
 AC_SUBST(RCC)
 
-AC_SUBST(MOZ_DFB)
 AC_SUBST(MOZ_X11)
 
 dnl ========================================================
 dnl =
 dnl = Components & Features
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Components and Features)
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -579,19 +579,16 @@ PluginModuleChild::InitGraphics()
 
 #elif defined(MOZ_WIDGET_QT)
     nsQAppInstance::AddRef();
     // Work around plugins that don't interact well without gtk initialized
     // see bug 566845
 #if defined(MOZ_X11)
     if (!sGtkLib)
          sGtkLib = PR_LoadLibrary("libgtk-x11-2.0.so.0");
-#elif defined(MOZ_DFB)
-    if (!sGtkLib)
-         sGtkLib = PR_LoadLibrary("libgtk-directfb-2.0.so.0");
 #endif
     if (sGtkLib) {
          s_gtk_init = (_gtk_init_fn)PR_FindFunctionSymbol(sGtkLib, "gtk_init");
          if (s_gtk_init)
              s_gtk_init(0, 0);
     }
 #else
     // may not be necessary on all platforms
--- a/gfx/thebes/Makefile.in
+++ b/gfx/thebes/Makefile.in
@@ -100,17 +100,16 @@ EXPORTS += \
 	$(NULL)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 EXPORTS += \
 	gfxPlatformMac.h \
 	gfxQuartzSurface.h \
 	gfxQuartzImageSurface.h \
-	gfxQuartzPDFSurface.h \
 	gfxQuartzNativeDrawing.h \
 	$(NULL)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 EXPORTS += \
 	gfxFT2FontBase.h \
 	gfxGdkNativeRenderer.h \
@@ -127,19 +126,16 @@ EXPORTS += \
 endif
 
 ifdef MOZ_PANGO
 EXPORTS += gfxPangoFonts.h
 else
 EXPORTS += gfxFT2Fonts.h
 endif
 
-ifdef MOZ_DFB
-EXPORTS += gfxDirectFBSurface.h
-endif
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
 EXPORTS	+= \
 	gfxOS2Fonts.h \
 	gfxOS2Platform.h \
 	gfxOS2Surface.h \
 	gfxPDFSurface.h \
@@ -323,24 +319,16 @@ endif
 
 CPPSRCS +=  gfxPlatformGtk.cpp gfxGdkNativeRenderer.cpp
 CPPSRCS +=	gfxPDFSurface.cpp gfxPSSurface.cpp
 CPPSRCS +=	gfxFontconfigUtils.cpp
 CPPSRCS +=	gfxFT2FontBase.cpp
 CPPSRCS +=	gfxFT2Utils.cpp
 CPPSRCS +=	nsUnicodeRange.cpp
 
-ifdef MOZ_DFB
-CSRCS = cairo-gdk-utils.c
-endif
-
-endif
-
-ifdef MOZ_DFB
-CPPSRCS += gfxDirectFBSurface.cpp
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
 CPPSRCS += gfxQtPlatform.cpp gfxQPainterSurface.cpp
 ifdef MOZ_X11
 CPPSRCS += gfxXlibSurface.cpp gfxQtNativeRenderer.cpp
 endif
 ifdef MOZ_PANGO
@@ -354,17 +342,16 @@ CPPSRCS +=	gfxFontconfigUtils.cpp
 CPPSRCS +=	nsUnicodeRange.cpp
 CPPSRCS +=	gfxPDFSurface.cpp
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 CPPSRCS	+= \
 	gfxQuartzSurface.cpp \
 	gfxQuartzImageSurface.cpp \
-	gfxQuartzPDFSurface.cpp \
 	gfxPlatformMac.cpp \
 	gfxMacFont.cpp \
 	gfxCoreTextShaper.cpp \
 	$(NULL)
 #CPPSRCS +=	gfxPDFSurface.cpp
 CPPSRCS +=      nsUnicodeRange.cpp
 CPPSRCS +=      gfxQuartzNativeDrawing.cpp
 
deleted file mode 100644
--- a/gfx/thebes/cairo-gdk-utils.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Novell code.
- *
- * The Initial Developer of the Original Code is Novell.
- * Portions created by the Initial Developer are Copyright (C) 2006
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   rocallahan@novell.com
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "cairo-gdk-utils.h"
-
-#include <stdlib.h>
-
-#if   HAVE_STDINT_H
-#include <stdint.h>
-#elif HAVE_INTTYPES_H
-#include <inttypes.h>
-#elif HAVE_SYS_INT_TYPES_H
-#include <sys/int_types.h>
-#endif
-
-
-/* We have three basic strategies available:
-   1) 'direct': cr targets a native surface, and other conditions are met: we can
-      pass the underlying drawable directly to the callback
-   2) 'opaque': the image is opaque: we can create a temporary cairo native surface,
-      pass its underlying drawable to the callback, and paint the result
-      using cairo
-   3) 'default': create a temporary cairo native surface, fill with black, pass its
-      underlying drawable to the callback, copy the results to a cairo
-      image surface, repeat with a white background, update the on-black
-      image alpha values by comparing the two images, then paint the on-black
-      image using cairo
-   Sure would be nice to have an X extension to do 3 for us on the server...
-*/
-
-static cairo_bool_t
-_convert_coord_to_short (double coord, short *v)
-{
-    *v = (short)coord;
-    /* XXX allow some tolerance here? */
-    return *v == coord;
-}
-
-static cairo_bool_t
-_convert_coord_to_unsigned_short (double coord, unsigned short *v)
-{
-    *v = (unsigned short)coord;
-    /* XXX allow some tolerance here? */
-    return *v == coord;
-}
-
-
-void cairo_draw_with_gdk (cairo_t *cr,
-                           cairo_gdk_drawing_callback callback,
-                           void * closure,
-                           unsigned int width, unsigned int height,
-                           cairo_gdk_drawing_opacity_t is_opaque,
-                           cairo_gdk_drawing_support_t capabilities,
-                           cairo_gdk_drawing_result_t *result)
-{
-    double device_offset_x, device_offset_y;
-    short offset_x = 0, offset_y = 0;
-    //cairo_surface_t * target = cairo_get_group_target (cr);
-    cairo_surface_t * target = cairo_get_target (cr);
-    cairo_matrix_t matrix;
-
-    cairo_surface_get_device_offset (target, &device_offset_x, &device_offset_y);
-    cairo_get_matrix (cr, &matrix);
-
-    _convert_coord_to_short (matrix.x0 + device_offset_x, &offset_x);
-    _convert_coord_to_short (matrix.y0 + device_offset_y, &offset_y);
-
-    cairo_surface_flush (target);
-    callback (closure, target, offset_x, offset_y, NULL, 0);
-    cairo_surface_mark_dirty (target);
-}
-
-
deleted file mode 100644
--- a/gfx/thebes/cairo-gdk-utils.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Novell code.
- *
- * The Initial Developer of the Original Code is Novell.
- * Portions created by the Initial Developer are Copyright (C) 2006
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   rocallahan@novell.com
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef CAIROGDKUTILS_H_
-#define CAIROGDKUTILS_H_
-
-#include "cairo.h"
-#include <gdk/gdk.h>
-
-CAIRO_BEGIN_DECLS
-
-/**
- * This callback encapsulates GDK-based rendering. We assume that the
- * execution of the callback is equivalent to compositing some RGBA image of
- * size (bounds_width, bounds_height) onto the drawable at offset (offset_x,
- * offset_y), clipped to the union of the clip_rects if num_rects is greater
- * than zero. This includes the assumption that the same RGBA image
- * is composited if you call the callback multiple times with the same closure,
- * display and visual during a single cairo_draw_with_gdk call.
- * 
- * @return True when able to draw, False otherwise
- */
-typedef cairo_bool_t (* cairo_gdk_drawing_callback)
-    (void *closure,
-     cairo_surface_t *surface,
-     short offset_x, short offset_y,
-     GdkRectangle * clip_rects, unsigned int num_rects);
-
-/**
- * This type specifies whether the native drawing callback draws all pixels
- * in its bounds opaquely, independent of the contents of the target drawable,
- * or whether it leaves pixels transparent/translucent or depends on the
- * existing contents of the target drawable in some way.
- */
-typedef enum _cairo_gdk_drawing_opacity {
-    CAIRO_GDK_DRAWING_OPAQUE,
-    CAIRO_GDK_DRAWING_TRANSPARENT
-} cairo_gdk_drawing_opacity_t;
-
-/**
- * This type encodes the capabilities of the native drawing callback.
- * 
- * If CAIRO_GDK_DRAWING_SUPPORTS_CLIP_RECT is set, then 'num_rects' can be
- * zero or one in the call to the callback. Otherwise 'num_rects' will be
- * zero.
- */
-typedef enum {
-    CAIRO_GDK_DRAWING_SUPPORTS_CLIP_RECT = 0x02,
-} cairo_gdk_drawing_support_t;
-
-/**
- * Draw GDK output into any cairo context. All cairo transforms and effects
- * are honored, including the current operator. This is equivalent to a
- * cairo_set_source_surface and then cairo_paint.
- * @param cr the context to draw into
- * @param drawable a GDK Drawable that we're targetting
- * @param callback the code to perform GDK rendering
- * @param closure associated data
- * @param width the width of the putative image drawn by the callback
- * @param height the height of the putative image drawn by the callback
- * @param is_opaque set to CAIRO_GDK_DRAWING_IS_OPAQUE to indicate
- * that all alpha values of the putative image will be 1.0; the pixels drawn into
- * the Drawable must not depend on the prior contents of the Drawable
- * in any way
- * @param capabilities the capabilities of the callback as described above.
- * @param result if non-NULL, we *may* fill in the struct with information about
- * the rendered image. 'surface' may be filled in with a surface representing
- * the image, similar to the target of 'cr'. If 'uniform_alpha' is True then
- * every pixel of the image has the same alpha value 'alpha'. If
- * 'uniform_color' is True then every pixel of the image has the same RGB
- * color (r, g, b). If the image has uniform color and alpha (or alpha is zero,
- * in which case the color is always uniform) then we won't bother returning
- * a surface for it.
- */
-void cairo_draw_with_gdk (cairo_t *cr,
-                          cairo_gdk_drawing_callback callback,
-                          void * closure,
-                          unsigned int width, unsigned int height,
-                          cairo_gdk_drawing_opacity_t is_opaque,
-                          cairo_gdk_drawing_support_t capabilities,
-                          cairo_gdk_drawing_result_t *result);
-
-CAIRO_END_DECLS
-
-#endif /*CAIROGDKUTILS_H_*/
--- a/gfx/thebes/gfxASurface.cpp
+++ b/gfx/thebes/gfxASurface.cpp
@@ -59,20 +59,16 @@
 #include "gfxXlibSurface.h"
 #endif
 
 #ifdef CAIRO_HAS_QUARTZ_SURFACE
 #include "gfxQuartzSurface.h"
 #include "gfxQuartzImageSurface.h"
 #endif
 
-#ifdef MOZ_DFB
-#include "gfxDirectFBSurface.h"
-#endif
-
 #if defined(CAIRO_HAS_QT_SURFACE) && defined(MOZ_WIDGET_QT)
 #include "gfxQPainterSurface.h"
 #endif
 
 #include <stdio.h>
 #include <limits.h>
 
 #include "imgIEncoder.h"
@@ -198,21 +194,16 @@ gfxASurface::Wrap (cairo_surface_t *csur
 #ifdef CAIRO_HAS_QUARTZ_SURFACE
     else if (stype == CAIRO_SURFACE_TYPE_QUARTZ) {
         result = new gfxQuartzSurface(csurf);
     }
     else if (stype == CAIRO_SURFACE_TYPE_QUARTZ_IMAGE) {
         result = new gfxQuartzImageSurface(csurf);
     }
 #endif
-#ifdef MOZ_DFB
-    else if (stype == CAIRO_SURFACE_TYPE_DIRECTFB) {
-        result = new gfxDirectFBSurface(csurf);
-    }
-#endif
 #if defined(CAIRO_HAS_QT_SURFACE) && defined(MOZ_WIDGET_QT)
     else if (stype == CAIRO_SURFACE_TYPE_QT) {
         result = new gfxQPainterSurface(csurf);
     }
 #endif
     else {
         result = new gfxUnknownSurface(csurf);
     }
@@ -574,21 +565,21 @@ static const SurfaceMemoryReporterAttrs 
     {"gfx-surface-pdf", nsnull},
     {"gfx-surface-ps", nsnull},
     {"gfx-surface-xlib",
      "Memory used by xlib surfaces to store pixmaps. This memory lives in "
      "the X server's process rather than in this application, so the bytes "
      "accounted for here aren't counted in vsize, resident, explicit, or any of "
      "the other measurements on this page."},
     {"gfx-surface-xcb", nsnull},
-    {"gfx-surface-glitz", nsnull},
+    {"gfx-surface-glitz???", nsnull},       // should never be used
     {"gfx-surface-quartz", nsnull},
     {"gfx-surface-win32", nsnull},
     {"gfx-surface-beos", nsnull},
-    {"gfx-surface-directfb", nsnull},
+    {"gfx-surface-directfb???", nsnull},    // should never be used
     {"gfx-surface-svg", nsnull},
     {"gfx-surface-os2", nsnull},
     {"gfx-surface-win32printing", nsnull},
     {"gfx-surface-quartzimage", nsnull},
     {"gfx-surface-script", nsnull},
     {"gfx-surface-qpainter", nsnull},
     {"gfx-surface-recording", nsnull},
     {"gfx-surface-vg", nsnull},
--- a/gfx/thebes/gfxASurface.h
+++ b/gfx/thebes/gfxASurface.h
@@ -75,21 +75,21 @@ public:
     } gfxImageFormat;
 
     typedef enum {
         SurfaceTypeImage,
         SurfaceTypePDF,
         SurfaceTypePS,
         SurfaceTypeXlib,
         SurfaceTypeXcb,
-        SurfaceTypeGlitz,
+        SurfaceTypeGlitz,           // unused, but needed for cairo parity
         SurfaceTypeQuartz,
         SurfaceTypeWin32,
         SurfaceTypeBeOS,
-        SurfaceTypeDirectFB,
+        SurfaceTypeDirectFB,        // unused, but needed for cairo parity
         SurfaceTypeSVG,
         SurfaceTypeOS2,
         SurfaceTypeWin32Printing,
         SurfaceTypeQuartzImage,
         SurfaceTypeScript,
         SurfaceTypeQPainter,
         SurfaceTypeRecording,
         SurfaceTypeVG,
deleted file mode 100644
--- a/gfx/thebes/gfxDirectFBSurface.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Corporation code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Vladimir Vukicevic <vladimir@pobox.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "gfxDirectFBSurface.h"
-
-#include "cairo-directfb.h"
-
-gfxDirectFBSurface::gfxDirectFBSurface(IDirectFB *dfb, IDirectFBSurface *dfbs)
-    : mDFB(nsnull), mDFBSurface(nsnull)
-{
-    dfb->AddRef( dfb );
-    dfbs->AddRef( dfbs );
-
-    cairo_surface_t *surf = cairo_directfb_surface_create(dfb, dfbs);
-
-    mDFB = dfb;
-    mDFBSurface = dfbs;
-
-    Init(surf);
-}
-
-gfxDirectFBSurface::gfxDirectFBSurface(IDirectFBSurface *dfbs)
-    : mDFB(nsnull), mDFBSurface(nsnull)
-{
-    DFBResult ret;
-
-    dfbs->AddRef( dfbs );
-
-    /* Lightweight, getting singleton */
-    ret = DirectFBCreate( &mDFB );
-    if (ret) {
-         D_DERROR( (DirectResult) ret, "gfxDirectFBSurface: DirectFBCreate() failed!\n" );
-         return;
-    }
-
-    cairo_surface_t *surf = cairo_directfb_surface_create(mDFB, dfbs);
-
-    mDFBSurface = dfbs;
-
-    Init(surf);
-}
-
-gfxDirectFBSurface::gfxDirectFBSurface(cairo_surface_t *csurf)
-{
-    mDFB = nsnull;
-    mDFBSurface = nsnull;
-
-    Init(csurf, true);
-}
-
-gfxDirectFBSurface::gfxDirectFBSurface(const gfxIntSize& size, gfxImageFormat format) :
-    mDFB(nsnull), mDFBSurface(nsnull)
-{
-     DFBResult             ret;
-     DFBSurfaceDescription desc;
-
-     if (!CheckSurfaceSize(size) || size.width <= 0 || size.height <= 0)
-          return;
-
-     /* Lightweight, getting singleton */
-     ret = DirectFBCreate( &mDFB );
-     if (ret) {
-          D_DERROR( (DirectResult) ret, "gfxDirectFBSurface: DirectFBCreate() failed!\n" );
-          return;
-     }
-
-     desc.flags  = (DFBSurfaceDescriptionFlags)( DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT );
-     desc.width  = size.width;
-     desc.height = size.height;
-
-     switch (format) {
-          case gfxASurface::ImageFormatARGB32:
-               desc.pixelformat = DSPF_ARGB;
-               break;
-
-          case gfxASurface::ImageFormatRGB24:
-               desc.pixelformat = DSPF_RGB32;
-               break;
-
-          case gfxASurface::ImageFormatA8:
-               desc.pixelformat = DSPF_A8;
-               break;
-
-          case gfxASurface::ImageFormatA1:
-               desc.pixelformat = DSPF_A1;
-               break;
-
-          default:
-               D_BUG( "unknown format" );
-               return;
-     }
-
-     ret = mDFB->CreateSurface( mDFB, &desc, &mDFBSurface );
-     if (ret) {
-          D_DERROR( (DirectResult) ret, "gfxDirectFBSurface: "
-                                        "IDirectFB::CreateSurface( %dx%d ) failed!\n", desc.width, desc.height );
-          return;
-     }
-
-     cairo_surface_t *surface = cairo_directfb_surface_create(mDFB, mDFBSurface);
-
-     Init(surface);
-}
-
-gfxDirectFBSurface::~gfxDirectFBSurface()
-{
-     if (mDFBSurface)
-          mDFBSurface->Release( mDFBSurface );
-
-     if (mDFB)
-          mDFB->Release( mDFB );
-}
-
deleted file mode 100644
--- a/gfx/thebes/gfxDirectFBSurface.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is DirectFB Thebes code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2008
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Vladimir Vukicevic <vladimir@pobox.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef GFX_DIRECTFBSURFACE_H
-#define GFX_DIRECTFBSURFACE_H
-
-#include "gfxASurface.h"
-
-extern "C" {
-#include "direct/messages.h"
-
-typedef struct _IDirectFB IDirectFB;
-typedef struct _IDirectFBSurface IDirectFBSurface;
-
-}
-
-class THEBES_API gfxDirectFBSurface : public gfxASurface {
-public:
-    gfxDirectFBSurface(IDirectFB *dfb, IDirectFBSurface *surface);
-    gfxDirectFBSurface(IDirectFBSurface *surface);
-    gfxDirectFBSurface(cairo_surface_t *csurf);
-
-    gfxDirectFBSurface(const gfxIntSize& size, gfxImageFormat format);
-
-    virtual ~gfxDirectFBSurface();
-
-    IDirectFB* DirectFB() { return mDFB; }
-    IDirectFBSurface* DirectFBSurface() { return mDFBSurface; }
-
-protected:
-    IDirectFB *mDFB;
-    IDirectFBSurface *mDFBSurface;
-};
-
-#endif /* GFX_DIRECTFBSURFACE_H */
--- a/gfx/thebes/gfxGdkNativeRenderer.cpp
+++ b/gfx/thebes/gfxGdkNativeRenderer.cpp
@@ -88,61 +88,8 @@ gfxGdkNativeRenderer::Draw(gfxContext* c
         gdk_x11_visual_get_xvisual(gdk_colormap_get_visual(colormap));
     Screen* screen =
         gdk_x11_screen_get_xscreen(gdk_colormap_get_screen(colormap));
 
     gfxXlibNativeRenderer::Draw(ctx, size, flags, screen, visual, nsnull);
 }
 
 #endif
-#ifdef MOZ_DFB
-
-#include "cairo-gdk-utils.h"
-
-typedef struct {
-    gfxGdkNativeRenderer* mRenderer;
-    nsresult               mRV;
-} NativeRenderingClosure;
-
-static cairo_bool_t
-NativeRendering(void *closure,
-                cairo_surface_t *surface,
-                short offset_x, short offset_y,
-                GdkRectangle * rectangles, unsigned int num_rects)
-{
-    NativeRenderingClosure* cl = (NativeRenderingClosure*)closure;
-    nsRefPtr<gfxASurface> gfxSurface = gfxASurface::Wrap(surface);
-    GdkDrawable *drawable = gfxPlatformGtk::GetGdkDrawable(gfxSurface);
-    if (!drawable)
-        return 0;
-
-    nsresult rv = cl->mRenderer->
-        DrawWithGDK(drawable, offset_x, offset_y,
-                    rectangles, num_rects);
-    cl->mRV = rv;
-    return NS_SUCCEEDED(rv);
-}
-
-void
-gfxGdkNativeRenderer::Draw(gfxContext* ctx, nsIntSize size,
-                           PRUint32 flags, GdkVisual* visual)
-{
-    NativeRenderingClosure closure = { this, NS_OK };
-    cairo_gdk_drawing_result_t result;
-  
-    int cairoFlags = 0;
-    if (flags & DRAW_SUPPORTS_CLIP_RECT) {
-        cairoFlags |= CAIRO_GDK_DRAWING_SUPPORTS_CLIP_RECT;
-    }
-    cairo_draw_with_gdk(ctx->GetCairo(),
-                        NativeRendering, 
-                        &closure, size.width, size.height,
-                        (flags & DRAW_IS_OPAQUE) ? CAIRO_GDK_DRAWING_OPAQUE : CAIRO_GDK_DRAWING_TRANSPARENT,
-                        (cairo_gdk_drawing_support_t)cairoFlags,
-                        NULL);
-    if (NS_FAILED(closure.mRV)) {
-        return closure.mRV;
-    }
-  
-    return NS_OK;
-}
-
-#endif // MOZ_DFB
deleted file mode 100644
--- a/gfx/thebes/gfxGlitzSurface.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Oracle Corporation code.
- *
- * The Initial Developer of the Original Code is Oracle Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2005
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Vladimir Vukicevic <vladimir@pobox.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef GFX_GLITZSURFACE_H
-#define GFX_GLITZSURFACE_H
-
-#include "gfxASurface.h"
-
-#include <cairo-glitz.h>
-
-/**
- * A surface that wraps a glitz surface.
- */
-class THEBES_API gfxGlitzSurface : public gfxASurface {
-public:
-    gfxGlitzSurface(glitz_drawable_t *drawable,
-                    glitz_surface_t *glitzSurface,
-                    bool takeOwnership = false);
-
-    virtual ~gfxGlitzSurface();
-
-    /**
-     * When double-buffering is used, swaps the back and the front buffer.
-     */
-    void SwapBuffers();
-
-    unsigned long Width();
-    unsigned long Height();
-
-    glitz_surface_t* GlitzSurface() { return mGlitzSurface; }
-    glitz_drawable_t* GlitzDrawable() { return mGlitzDrawable; }
-
-protected:
-    glitz_drawable_t *mGlitzDrawable;
-    glitz_surface_t *mGlitzSurface;
-    bool mOwnsSurface;
-};
-
-#endif /* GFX_GLITZSURFACE_H */
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -67,24 +67,16 @@
 
 /* Undefine the Status from Xlib since it will conflict with system headers on OSX */
 #if defined(__APPLE__) && defined(Status)
 #undef Status
 #endif
 
 #endif /* MOZ_X11 */
 
-#ifdef MOZ_DFB
-#include "gfxDirectFBSurface.h"
-#endif
-
-#ifdef MOZ_DFB
-#include "gfxDirectFBSurface.h"
-#endif
-
 #include <fontconfig/fontconfig.h>
 
 #include "nsMathUtils.h"
 
 #define GDK_PIXMAP_SIZE_MAX 32767
 
 #ifndef MOZ_PANGO
 #include <ft2build.h>
@@ -199,23 +191,16 @@ gfxPlatformGtk::CreateOffscreenSurface(c
 
             if (xrenderFormat) {
                 newSurface = gfxXlibSurface::Create(screen, xrenderFormat, size);
             }
         }
     }
 #endif
 
-#ifdef MOZ_DFB
-    if (size.width < GDK_PIXMAP_SIZE_MAX && size.height < GDK_PIXMAP_SIZE_MAX) {
-        newSurface = new gfxDirectFBSurface(size, imageFormat);
-    }
-#endif
-
-
     if (!newSurface) {
         // We couldn't create a native surface for whatever reason;
         // e.g., no display, no RENDER, bad size, etc.
         // Fall back to image surface for the data.
         newSurface = new gfxImageSurface(size, imageFormat);
     }
 
     if (newSurface->CairoStatus()) {
deleted file mode 100644
--- a/gfx/thebes/gfxQuartzPDFSurface.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Corporation code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2006
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Stuart Parmenter <stuart@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "gfxQuartzPDFSurface.h"
-
-#include "cairo-quartz.h"
-
-gfxQuartzPDFSurface::gfxQuartzPDFSurface(const char *filename, gfxSize aSizeInPoints)
-{
-    mRect = CGRectMake(0.0, 0.0, aSizeInPoints.width, aSizeInPoints.height);
-
-    CFStringRef file = CFStringCreateWithCString(kCFAllocatorDefault, filename, kCFStringEncodingUTF8);
-    CFURLRef fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, file, kCFURLPOSIXPathStyle, false);
-    mCGContext = CGPDFContextCreateWithURL(fileURL, &mRect, NULL);
-
-    CFRelease(file);
-    CFRelease(fileURL);
-
-    Init(cairo_quartz_surface_create_for_cg_context(mCGContext, aSizeInPoints.width, aSizeInPoints.height));
-}
-
-gfxQuartzPDFSurface::~gfxQuartzPDFSurface()
-{
-    CGContextRelease(mCGContext);
-}
-
-
-nsresult
-gfxQuartzPDFSurface::BeginPrinting(const nsAString& aTitle, const nsAString& aPrintToFileName)
-{
-    return NS_OK;
-}
-
-nsresult
-gfxQuartzPDFSurface::EndPrinting()
-{
-    return NS_OK;
-}
-
-nsresult
-gfxQuartzPDFSurface::AbortPrinting()
-{
-    return NS_OK;
-}
-
-nsresult
-gfxQuartzPDFSurface::BeginPage()
-{
-    CGContextBeginPage(mCGContext, &mRect);
-
-    return NS_OK;
-}
-
-nsresult
-gfxQuartzPDFSurface::EndPage()
-{
-    CGContextEndPage(mCGContext);
-    return NS_OK;
-}
deleted file mode 100644
--- a/gfx/thebes/gfxQuartzPDFSurface.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Corporation code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2006
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Stuart Parmenter <stuart@mozilla.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef GFX_QUARTZPDFSURFACE_H
-#define GFX_QUARTZPDFSURFACE_H
-
-#include "gfxASurface.h"
-#include "gfxContext.h"
-
-#include <Carbon/Carbon.h>
-
-class THEBES_API gfxQuartzPDFSurface : public gfxASurface {
-public:
-    gfxQuartzPDFSurface(const char *filename, gfxSize aSizeInPoints);
-    virtual ~gfxQuartzPDFSurface();
-
-    nsresult BeginPrinting(const nsAString& aTitle, const nsAString& aPrintToFileName);
-    nsresult EndPrinting();
-    nsresult AbortPrinting();
-    nsresult BeginPage();
-    nsresult EndPage();
-
-    virtual const gfxIntSize GetSize() const {
-        gfxIntSize size(mRect.size.width, mRect.size.height);
-        return size;
-    }
-
-    CGContextRef GetCGContext() { return mCGContext; }
-
-    virtual PRInt32 GetDefaultContextFlags() const
-    {
-      return gfxContext::FLAG_DISABLE_SNAPPING |
-             gfxContext::FLAG_DISABLE_COPY_BACKGROUND;
-    }
-
-protected:
-    CGContextRef mCGContext;
-    CGRect mRect;
-};
-#endif /* GFX_QUARTZPDFSURFACE_H */
--- a/js/src/config/system-headers
+++ b/js/src/config/system-headers
@@ -108,21 +108,16 @@ fusion/lock.h
 fusion/types.h
 fusion/vector.h
 fusion/call.h
 fusion/shmalloc.h
 fusion/protocol.h
 fusion/fusion.h
 fusion/arena.h
 fusion/object.h
-directfbgl.h
-directfb_version.h
-directfb.h
-directfb_util.h
-directfb_keynames.h
 dgiff.h
 direct/util.h
 direct/memcpy.h
 direct/interface.h
 direct/conf.h
 direct/tree.h
 direct/signals.h
 direct/build.h
--- a/widget/src/gtk2/nsBidiKeyboard.cpp
+++ b/widget/src/gtk2/nsBidiKeyboard.cpp
@@ -51,19 +51,16 @@ static GdkKeymapHaveBidiLayoutsType GdkK
 
 NS_IMPL_ISUPPORTS1(nsBidiKeyboard, nsIBidiKeyboard)
 
 nsBidiKeyboard::nsBidiKeyboard()
 {
 #if defined(MOZ_X11)
     if (!gtklib)
         gtklib = PR_LoadLibrary("libgtk-x11-2.0.so.0");
-#elif defined(MOZ_DFB)
-    if (!gtklib)
-        gtklib = PR_LoadLibrary("libgtk-directfb-2.0.so.0");
 #else
     return;
 #endif
 
     if (gtklib && !GdkKeymapHaveBidiLayouts)
             GdkKeymapHaveBidiLayouts = (GdkKeymapHaveBidiLayoutsType) PR_FindFunctionSymbol(gtklib, "gdk_keymap_have_bidi_layouts");
 
     SetHaveBidiKeyboards();
--- a/widget/src/gtk2/nsScreenManagerGtk.cpp
+++ b/widget/src/gtk2/nsScreenManagerGtk.cpp
@@ -40,20 +40,16 @@
 #include "nsScreenManagerGtk.h"
 #include "nsScreenGtk.h"
 #include "nsIComponentManager.h"
 #include "nsRect.h"
 #include "nsAutoPtr.h"
 
 #define SCREEN_MANAGER_LIBRARY_LOAD_FAILED ((PRLibrary*)1)
 
-#ifdef MOZ_DFB
-#include <directfb.h>
-#endif
-
 #ifdef MOZ_X11
 #include <gdk/gdkx.h>
 // prototypes from Xinerama.h
 typedef Bool (*_XnrmIsActive_fn)(Display *dpy);
 typedef XineramaScreenInfo* (*_XnrmQueryScreens_fn)(Display *dpy, int *number);
 #endif
 
 #include <gtk/gtk.h>
@@ -80,33 +76,16 @@ root_window_event_filter(GdkXEvent *aGdk
         }
       }
       break;
     default:
       break;
   }
 #endif
 
-#ifdef MOZ_DFB
-  DFBWindowEvent * dfbEvent = static_cast<DFBWindowEvent *> (aGdkXEvent);
-
-  switch (dfbEvent->type)
-  {
-      case DWET_POSITION :
-      case DWET_SIZE :
-          manager->Init();
-      break;
-
-          /* TODO: Need to find out PropertyNotify equivalent in
-           * DFB.. */
-      default :
-      break;
-  }
-#endif
-
   return GDK_FILTER_CONTINUE;
 }
 
 nsScreenManagerGtk :: nsScreenManagerGtk ( )
   : mXineramalib(nsnull)
   , mRootWindow(nsnull)
 {
   // nothing else to do. I guess we could cache a bunch of information
--- a/widget/src/gtk2/nsWindow.cpp
+++ b/widget/src/gtk2/nsWindow.cpp
@@ -153,30 +153,16 @@ extern "C" {
 
 #ifdef MOZ_X11
 #include "gfxXlibSurface.h"
 #include "cairo-xlib.h"
 #endif
 
 #include "nsShmImage.h"
 
-#ifdef MOZ_DFB
-extern "C" {
-#ifdef MOZ_DIRECT_DEBUG
-#define DIRECT_ENABLE_DEBUG
-#endif
-
-#include <direct/debug.h>
-
-D_DEBUG_DOMAIN( ns_Window, "nsWindow", "nsWindow" );
-}
-#include "gfxDirectFBSurface.h"
-#define GDK_WINDOW_XWINDOW(_win) _win
-#endif
-
 using namespace mozilla;
 using namespace mozilla::widget;
 using mozilla::gl::GLContext;
 using mozilla::layers::LayerManagerOGL;
 
 // Don't put more than this many rects in the dirty region, just fluff
 // out to the bounding-box if there are more
 #define MAX_RECTS_IN_REGION 100
@@ -444,46 +430,28 @@ nsWindow::nsWindow()
     mRootAccessible  = nsnull;
 #endif
 
     mIsTransparent = false;
     mTransparencyBitmap = nsnull;
 
     mTransparencyBitmapWidth  = 0;
     mTransparencyBitmapHeight = 0;
-
-#ifdef MOZ_DFB
-    mDFBCursorX     = 0;
-    mDFBCursorY     = 0;
-
-    mDFBCursorCount = 0;
-
-    mDFB            = NULL;
-    mDFBLayer       = NULL;
-#endif
 }
 
 nsWindow::~nsWindow()
 {
     LOG(("nsWindow::~nsWindow() [%p]\n", (void *)this));
     if (sLastDragMotionWindow == this) {
         sLastDragMotionWindow = NULL;
     }
 
     delete[] mTransparencyBitmap;
     mTransparencyBitmap = nsnull;
 
-#ifdef MOZ_DFB
-    if (mDFBLayer)
-         mDFBLayer->Release( mDFBLayer );
-
-    if (mDFB)
-         mDFB->Release( mDFB );
-#endif
-
     Destroy();
 }
 
 /* static */ void
 nsWindow::ReleaseGlobals()
 {
   for (PRUint32 i = 0; i < ArrayLength(gCursorCache); ++i) {
     if (gCursorCache[i]) {
@@ -2251,27 +2219,16 @@ nsWindow::OnExposeEvent(cairo_t *cr)
     }
             
 #if defined(MOZ_WIDGET_GTK2)
     nsRefPtr<gfxContext> ctx = new gfxContext(GetThebesSurface());
 #else
     nsRefPtr<gfxContext> ctx = new gfxContext(GetThebesSurface(cr));
 #endif
 
-#ifdef MOZ_DFB
-    gfxPlatformGtk::SetGdkDrawable(ctx->OriginalSurface(),
-                                   GDK_DRAWABLE(mGdkWindow));
-
-    // clip to the update region
-    gfxUtils::ClipToRegion(ctx, event.region);
-
-    BasicLayerManager::BufferMode layerBuffering =
-        BasicLayerManager::BUFFER_NONE;
-#endif
-
 #ifdef MOZ_X11
     nsIntRect boundsRect; // for translucent only
 
     ctx->NewPath();
     if (translucent) {
         // Collapse update area to the bounding box. This is so we only have to
         // call UpdateTranslucentWindowAlpha once. After we have dropped
         // support for non-Thebes graphics, UpdateTranslucentWindowAlpha will be
@@ -2593,78 +2550,16 @@ nsWindow::OnLeaveNotifyEvent(GtkWidget *
         ? nsMouseEvent::eTopLevel : nsMouseEvent::eChild;
 
     LOG(("OnLeaveNotify: %p\n", (void *)this));
 
     nsEventStatus status;
     DispatchEvent(&event, status);
 }
 
-#ifdef MOZ_DFB
-void
-nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent)
-{
-    int cursorX = (int) aEvent->x_root;
-    int cursorY = (int) aEvent->y_root;
-
-    D_DEBUG_AT( ns_Window, "%s( %4d,%4d - [%d] )\n", __FUNCTION__, cursorX, cursorY, mDFBCursorCount );
-
-    D_ASSUME( mDFBLayer != NULL );
-
-    if (mDFBLayer)
-         mDFBLayer->GetCursorPosition( mDFBLayer, &cursorX, &cursorY );
-
-    mDFBCursorCount++;
-
-#if D_DEBUG_ENABLED
-    if (cursorX != (int) aEvent->x_root || cursorY != (int) aEvent->y_root)
-         D_DEBUG_AT( ns_Window, "  -> forward to %4d,%4d\n", cursorX, cursorY );
-#endif
-
-    if (cursorX == mDFBCursorX && cursorY == mDFBCursorY) {
-         D_DEBUG_AT( ns_Window, "  -> dropping %4d,%4d\n", cursorX, cursorY );
-
-         /* drop zero motion */
-         return;
-    }
-
-    mDFBCursorX = cursorX;
-    mDFBCursorY = cursorY;
-
-
-    // when we receive this, it must be that the gtk dragging is over,
-    // it is dropped either in or out of mozilla, clear the flag
-    sIsDraggingOutOf = false;
-
-    nsMouseEvent event(true, NS_MOUSE_MOVE, this, nsMouseEvent::eReal);
-
-    // should we move this into !synthEvent?
-    gdouble pressure = 0;
-    gdk_event_get_axis ((GdkEvent*)aEvent, GDK_AXIS_PRESSURE, &pressure);
-    // Sometime gdk generate 0 pressure value between normal values
-    // We have to ignore that and use last valid value
-    if (pressure)
-      mLastMotionPressure = pressure;
-    event.pressure = mLastMotionPressure;
-
-    event.refPoint = nsIntPoint(cursorX, cursorY) - WidgetToScreenOffset();
-
-    event.isShift   = (aEvent->state & GDK_SHIFT_MASK)
-        ? true : false;
-    event.isControl = (aEvent->state & GDK_CONTROL_MASK)
-        ? true : false;
-    event.isAlt     = (aEvent->state & GDK_MOD1_MASK)
-        ? true : false;
-
-    event.time = aEvent->time;
-
-    nsEventStatus status;
-    DispatchEvent(&event, status);
-}
-#else
 void
 nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent)
 {
     // when we receive this, it must be that the gtk dragging is over,
     // it is dropped either in or out of mozilla, clear the flag
     sIsDraggingOutOf = false;
 
     // see if we can compress this event
@@ -2748,17 +2643,16 @@ nsWindow::OnMotionNotifyEvent(GtkWidget 
             ? true : false;
 
         event.time = aEvent->time;
     }
 
     nsEventStatus status;
     DispatchEvent(&event, status);
 }
-#endif
 
 // If the automatic pointer grab on ButtonPress has deactivated before
 // ButtonRelease, and the mouse button is released while the pointer is not
 // over any a Gecko window, then the ButtonRelease event will not be received.
 // (A similar situation exists when the pointer is grabbed with owner_events
 // True as the ButtonRelease may be received on a foreign [plugin] window).
 // Use this method to check for released buttons when the pointer returns to a
 // Gecko window.
@@ -4375,32 +4269,16 @@ nsWindow::Create(nsIWidget        *aPare
                 // will be done soon later.
                 gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
                                &sAccessibilityEnabled);
             }
         }
     }
 #endif
 
-#ifdef MOZ_DFB
-    if (!mDFB) {
-         DirectFBCreate( &mDFB );
-
-         D_ASSUME( mDFB != NULL );
-
-         if (mDFB)
-              mDFB->GetDisplayLayer( mDFB, DLID_PRIMARY, &mDFBLayer );
-
-         D_ASSUME( mDFBLayer != NULL );
-
-         if (mDFBLayer)
-              mDFBLayer->GetCursorPosition( mDFBLayer, &mDFBCursorX, &mDFBCursorY );
-    }
-#endif
-
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::SetWindowClass(const nsAString &xulWinType)
 {
   if (!mShell)
     return NS_ERROR_FAILURE;
@@ -6799,20 +6677,16 @@ nsWindow::GetThebesSurface(cairo_t *cr)
 #if MOZ_TREE_CAIRO
 #error "cairo-gtk3 target must be built with --enable-system-cairo"
 #else
     mThebesSurface = gfxASurface::Wrap(surf);
 #endif
 #endif
 
 #endif
-#ifdef MOZ_DFB
-    // not supported
-    mThebesSurface = nsnull;
-#endif
 
     // if the surface creation is reporting an error, then
     // we don't have a surface to give back
     if (mThebesSurface && mThebesSurface->CairoStatus() != 0) {
         mThebesSurface = nsnull;
     }
 
     return mThebesSurface;
--- a/widget/src/gtk2/nsWindow.h
+++ b/widget/src/gtk2/nsWindow.h
@@ -53,20 +53,16 @@
 
 #include "gfxASurface.h"
 
 #include "nsBaseWidget.h"
 #include "nsGUIEvent.h"
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 
-#ifdef MOZ_DFB
-#include <gdk/gdkdirectfb.h>
-#endif /* MOZ_DFB */
-
 #ifdef MOZ_X11
 #include <gdk/gdkx.h>
 #endif /* MOZ_X11 */
 
 #ifdef ACCESSIBILITY
 #include "nsAccessible.h"
 #endif
 
@@ -413,24 +409,16 @@ private:
     PRInt32             mTransparencyBitmapHeight;
 
 #ifdef MOZ_HAVE_SHMIMAGE
     // If we're using xshm rendering, mThebesSurface wraps mShmImage
     nsRefPtr<nsShmImage>  mShmImage;
 #endif
     nsRefPtr<gfxASurface> mThebesSurface;
 
-#ifdef MOZ_DFB
-    int                    mDFBCursorX;
-    int                    mDFBCursorY;
-    PRUint32               mDFBCursorCount;
-    IDirectFB             *mDFB;
-    IDirectFBDisplayLayer *mDFBLayer;
-#endif
-
 #ifdef ACCESSIBILITY
     nsRefPtr<nsAccessible> mRootAccessible;
 
     /**
      * Request to create the accessible for this window if it is top level.
      */
     void                CreateRootAccessible();