Bug 435739 Poor performance of Firefox 3 with no X RENDER extension
r=vladimir
--- a/gfx/thebes/src/gfxPlatformGtk.cpp
+++ b/gfx/thebes/src/gfxPlatformGtk.cpp
@@ -140,64 +140,46 @@ gfxPlatformGtk::CreateOffscreenSurface(c
if (!display)
return nsnull;
if (!UseGlitz()) {
GdkPixmap* pixmap = nsnull;
XRenderPictFormat* xrenderFormat =
XRenderFindStandardFormat(display, xrenderFormatID);
- if (!xrenderFormat) {
- // We don't have Render; see if we can just create a pixmap
- // of the requested depth.
- GdkVisual* vis;
-
- if (imageFormat == gfxASurface::ImageFormatRGB24) {
- vis = gdk_rgb_get_visual();
- if (vis->type == GDK_VISUAL_TRUE_COLOR)
- pixmap = gdk_pixmap_new(nsnull, size.width, size.height, vis->depth);
- }
-
- if (pixmap) {
- gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap), nsnull);
- newSurface = new gfxXlibSurface(display,
- GDK_PIXMAP_XID(GDK_DRAWABLE(pixmap)),
- GDK_VISUAL_XVISUAL(vis),
- size);
- }
- } else {
+ if (xrenderFormat) {
pixmap = gdk_pixmap_new(nsnull, size.width, size.height,
xrenderFormat->depth);
if (pixmap) {
gdk_drawable_set_colormap(GDK_DRAWABLE(pixmap), nsnull);
newSurface = new gfxXlibSurface(display,
GDK_PIXMAP_XID(GDK_DRAWABLE(pixmap)),
xrenderFormat,
size);
}
- }
- if (newSurface && newSurface->CairoStatus() == 0) {
- // set up the surface to auto-unref the gdk pixmap when the surface
- // is released
- newSurface->SetData(&cairo_gdk_pixmap_key,
- pixmap,
- do_gdk_pixmap_unref);
- } else {
- // something went wrong with the surface creation. Ignore and let's fall back
- // to image surfaces.
- if (pixmap)
- gdk_pixmap_unref(pixmap);
- newSurface = nsnull;
+ if (newSurface && newSurface->CairoStatus() == 0) {
+ // set up the surface to auto-unref the gdk pixmap when
+ // the surface is released
+ newSurface->SetData(&cairo_gdk_pixmap_key,
+ pixmap,
+ do_gdk_pixmap_unref);
+ } else {
+ // something went wrong with the surface creation.
+ // Ignore and let's fall back to image surfaces.
+ if (pixmap)
+ gdk_pixmap_unref(pixmap);
+ newSurface = nsnull;
+ }
}
if (!newSurface) {
- // we couldn't create an xlib surface for whatever reason; fall back to
- // image surface for the data.
+ // We don't have Render or we couldn't create an xlib surface for
+ // whatever reason; fall back to image surface for the data.
newSurface = new gfxImageSurface(gfxIntSize(size.width, size.height), imageFormat);
}
} else {
#ifdef MOZ_ENABLE_GLITZ
glitz_drawable_format_t *gdformat = glitz_glx_find_pbuffer_format
(display,
gdk_x11_get_default_screen(),