mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backout changeset 850ff2cf2868, ba88e35da4e7 due to crash on SVG test
This commit is contained in:
parent
f099a26551
commit
3baacdf6ed
@ -194,47 +194,6 @@ static const XTransform identity = { {
|
||||
(CAIRO_SURFACE_RENDER_HAS_PDF_OPERATORS(surface) && \
|
||||
(op) <= CAIRO_OPERATOR_HSL_LUMINOSITY))
|
||||
|
||||
static Visual *
|
||||
_visual_for_xrender_format(Screen *screen,
|
||||
XRenderPictFormat *xrender_format)
|
||||
{
|
||||
int d, v;
|
||||
for (d = 0; d < screen->ndepths; d++) {
|
||||
Depth *d_info = &screen->depths[d];
|
||||
if (d_info->depth != xrender_format->depth)
|
||||
continue;
|
||||
|
||||
for (v = 0; v < d_info->nvisuals; v++) {
|
||||
Visual *visual = &d_info->visuals[v];
|
||||
|
||||
switch (visual->class) {
|
||||
case TrueColor:
|
||||
if (xrender_format->type != PictTypeDirect)
|
||||
continue;
|
||||
break;
|
||||
case DirectColor:
|
||||
/* Prefer TrueColor to DirectColor.
|
||||
(XRenderFindVisualFormat considers both TrueColor and
|
||||
DirectColor Visuals to match the same PictFormat.) */
|
||||
continue;
|
||||
case StaticGray:
|
||||
case GrayScale:
|
||||
case StaticColor:
|
||||
case PseudoColor:
|
||||
if (xrender_format->type != PictTypeIndexed)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
if (xrender_format ==
|
||||
XRenderFindVisualFormat (DisplayOfScreen(screen), visual))
|
||||
return visual;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_cairo_xlib_surface_set_clip_region (cairo_xlib_surface_t *surface,
|
||||
cairo_region_t *region)
|
||||
@ -359,9 +318,6 @@ _cairo_xlib_surface_create_similar (void *abstract_src,
|
||||
visual = NULL;
|
||||
if (xrender_format == src->xrender_format)
|
||||
visual = src->visual;
|
||||
else
|
||||
visual = _visual_for_xrender_format(src->screen->screen,
|
||||
xrender_format);
|
||||
|
||||
surface = (cairo_xlib_surface_t *)
|
||||
_cairo_xlib_surface_create_internal (src->screen, pix,
|
||||
@ -3227,7 +3183,6 @@ cairo_xlib_surface_create_with_xrender_format (Display *dpy,
|
||||
cairo_xlib_screen_t *screen;
|
||||
cairo_surface_t *surface;
|
||||
cairo_status_t status;
|
||||
Visual *visual;
|
||||
|
||||
if (width > XLIB_COORD_MAX || height > XLIB_COORD_MAX)
|
||||
return _cairo_surface_create_in_error (CAIRO_STATUS_INVALID_SIZE);
|
||||
@ -3238,11 +3193,8 @@ cairo_xlib_surface_create_with_xrender_format (Display *dpy,
|
||||
|
||||
X_DEBUG ((dpy, "create_with_xrender_format (drawable=%x)", (unsigned int) drawable));
|
||||
|
||||
if (format)
|
||||
visual = _visual_for_xrender_format (scr, format);
|
||||
|
||||
surface = _cairo_xlib_surface_create_internal (screen, drawable,
|
||||
visual, format,
|
||||
NULL, format,
|
||||
width, height, 0);
|
||||
_cairo_xlib_screen_destroy (screen);
|
||||
|
||||
@ -3466,27 +3418,23 @@ cairo_xlib_surface_get_screen (cairo_surface_t *abstract_surface)
|
||||
* cairo_xlib_surface_get_visual:
|
||||
* @surface: a #cairo_xlib_surface_t
|
||||
*
|
||||
* Gets the X Visual associated with @surface, suitable for use with the
|
||||
* underlying X Drawable. If @surface was created by
|
||||
* cairo_xlib_surface_create(), the return value is the Visual passed to that
|
||||
* constructor.
|
||||
* Get the X Visual used for underlying X Drawable.
|
||||
*
|
||||
* Return value: the Visual or %NULL if there is no appropriate Visual for
|
||||
* @surface.
|
||||
* Return value: the visual.
|
||||
*
|
||||
* Since: 1.2
|
||||
**/
|
||||
Visual *
|
||||
cairo_xlib_surface_get_visual (cairo_surface_t *surface)
|
||||
cairo_xlib_surface_get_visual (cairo_surface_t *abstract_surface)
|
||||
{
|
||||
cairo_xlib_surface_t *xlib_surface = (cairo_xlib_surface_t *) surface;
|
||||
cairo_xlib_surface_t *surface = (cairo_xlib_surface_t *) abstract_surface;
|
||||
|
||||
if (! _cairo_surface_is_xlib (surface)) {
|
||||
if (! _cairo_surface_is_xlib (abstract_surface)) {
|
||||
_cairo_error_throw (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return xlib_surface->visual;
|
||||
return surface->visual;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -164,6 +164,12 @@ gfxPlatformGtk::CreateOffscreenSurface(const gfxIntSize& size,
|
||||
gfxASurface::gfxImageFormat imageFormat)
|
||||
{
|
||||
nsRefPtr<gfxASurface> newSurface = nsnull;
|
||||
PRBool sizeOk = PR_TRUE;
|
||||
|
||||
if (size.width >= GDK_PIXMAP_SIZE_MAX ||
|
||||
size.height >= GDK_PIXMAP_SIZE_MAX)
|
||||
sizeOk = PR_FALSE;
|
||||
|
||||
#ifdef MOZ_X11
|
||||
// XXX we really need a different interface here, something that passes
|
||||
// in more context, including the display and/or target surface type that
|
||||
@ -172,6 +178,7 @@ gfxPlatformGtk::CreateOffscreenSurface(const gfxIntSize& size,
|
||||
if (!display)
|
||||
return nsnull;
|
||||
|
||||
GdkPixmap* pixmap = nsnull;
|
||||
// try to optimize it for 16bpp default screen
|
||||
if (gfxASurface::ImageFormatRGB24 == imageFormat
|
||||
&& 16 == gdk_visual_get_system()->depth)
|
||||
@ -180,20 +187,37 @@ gfxPlatformGtk::CreateOffscreenSurface(const gfxIntSize& size,
|
||||
XRenderPictFormat* xrenderFormat =
|
||||
gfxXlibSurface::FindRenderFormat(display, imageFormat);
|
||||
|
||||
if (xrenderFormat) {
|
||||
newSurface = new gfxXlibSurface(display, xrenderFormat, size);
|
||||
if (newSurface && newSurface->CairoStatus() != 0) {
|
||||
if (xrenderFormat && sizeOk) {
|
||||
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
|
||||
SetGdkDrawable(newSurface, GDK_DRAWABLE(pixmap));
|
||||
} else {
|
||||
// something went wrong with the surface creation.
|
||||
// Ignore and let's fall back to image surfaces.
|
||||
newSurface = nsnull;
|
||||
}
|
||||
|
||||
// always unref; SetGdkDrawable takes its own ref
|
||||
if (pixmap)
|
||||
g_object_unref(pixmap);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_DFB
|
||||
if (size.width < GDK_PIXMAP_SIZE_MAX && size.height < GDK_PIXMAP_SIZE_MAX) {
|
||||
if (sizeOk)
|
||||
newSurface = new gfxDirectFBSurface(size, imageFormat);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -105,9 +105,6 @@ gfxXlibSurface::gfxXlibSurface(Display *dpy, Drawable drawable, XRenderPictForma
|
||||
gfxXlibSurface::gfxXlibSurface(Display *dpy, XRenderPictFormat *format, const gfxIntSize& size)
|
||||
: mPixmapTaken(PR_FALSE), mDisplay(dpy), mSize(size)
|
||||
{
|
||||
if (!CheckSurfaceSize(size, XLIB_IMAGE_SIDE_SIZE_LIMIT))
|
||||
return;
|
||||
|
||||
mDrawable = (Drawable)XCreatePixmap(dpy,
|
||||
RootWindow(dpy, DefaultScreen(dpy)),
|
||||
mSize.width, mSize.height,
|
||||
|
Loading…
Reference in New Issue
Block a user