зеркало из https://github.com/mozilla/pjs.git
Bug 435739 Poor performance of Firefox 3 with no X RENDER extension
r=vladimir
This commit is contained in:
Родитель
6ad618556a
Коммит
8a56036b85
|
@ -145,25 +145,7 @@ gfxPlatformGtk::CreateOffscreenSurface(const gfxIntSize& size,
|
|||
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);
|
||||
|
||||
|
@ -174,25 +156,25 @@ gfxPlatformGtk::CreateOffscreenSurface(const gfxIntSize& size,
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче