roll back cairo commit c1062bf to fix assertion failures

This commit is contained in:
vladimir@pobox.com 2008-04-07 02:17:14 -07:00
Родитель 9d68788e11
Коммит bf03b0ce8a
2 изменённых файлов: 136 добавлений и 20 удалений

Просмотреть файл

@ -48,16 +48,6 @@
typedef int (*cairo_xlib_error_func_t) (Display *display,
XErrorEvent *event);
static cairo_surface_t *
_cairo_xlib_surface_create_internal (Display *dpy,
Drawable drawable,
Screen *screen,
Visual *visual,
XRenderPictFormat *xrender_format,
int width,
int height,
int depth);
static cairo_status_t
_cairo_xlib_surface_ensure_gc (cairo_xlib_surface_t *surface);
@ -81,6 +71,10 @@ _cairo_xlib_surface_show_glyphs (void *abstract_dst,
int num_glyphs,
cairo_scaled_font_t *scaled_font);
#if CAIRO_HAS_XLIB_XRENDER_SURFACE
slim_hidden_proto (cairo_xlib_surface_create_with_xrender_format);
#endif
/*
* Instead of taking two round trips for each blending request,
* assume that if a particular drawable fails GetImage that it will
@ -179,11 +173,9 @@ _cairo_xlib_surface_create_similar_with_format (void *abstract_src,
depth);
surface = (cairo_xlib_surface_t *)
_cairo_xlib_surface_create_internal (dpy, pix,
src->screen, src->visual,
xrender_format,
width, height,
depth);
cairo_xlib_surface_create_with_xrender_format (dpy, pix, src->screen,
xrender_format,
width, height);
if (surface->base.status) {
XFreePixmap (dpy, pix);
return &surface->base;
@ -259,11 +251,10 @@ _cairo_xlib_surface_create_similar (void *abstract_src,
xrender_format->depth);
surface = (cairo_xlib_surface_t *)
_cairo_xlib_surface_create_internal (src->dpy, pix,
src->screen, src->visual,
xrender_format,
width, height,
xrender_format->depth);
cairo_xlib_surface_create_with_xrender_format (src->dpy, pix,
src->screen,
xrender_format,
width, height);
if (surface->base.status != CAIRO_STATUS_SUCCESS) {
XFreePixmap (src->dpy, pix);
return &surface->base;
@ -2401,6 +2392,7 @@ cairo_xlib_surface_create_with_xrender_format (Display *dpy,
return _cairo_xlib_surface_create_internal (dpy, drawable, screen,
NULL, format, width, height, 0);
}
slim_hidden_def (cairo_xlib_surface_create_with_xrender_format);
/**
* cairo_xlib_surface_get_xrender_format:

Просмотреть файл

@ -0,0 +1,124 @@
Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvsroot/mozilla/gfx/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.41
diff -u -p -8 -r1.41 cairo-xlib-surface.c
--- cairo-xlib-surface.c 7 Apr 2008 05:09:45 -0000 1.41
+++ cairo-xlib-surface.c 7 Apr 2008 09:16:50 -0000
@@ -43,26 +43,16 @@
#include "cairo-clip-private.h"
#include <X11/Xutil.h> /* for XDestroyImage */
/* Xlib doesn't define a typedef, so define one ourselves */
typedef int (*cairo_xlib_error_func_t) (Display *display,
XErrorEvent *event);
-static cairo_surface_t *
-_cairo_xlib_surface_create_internal (Display *dpy,
- Drawable drawable,
- Screen *screen,
- Visual *visual,
- XRenderPictFormat *xrender_format,
- int width,
- int height,
- int depth);
-
static cairo_status_t
_cairo_xlib_surface_ensure_gc (cairo_xlib_surface_t *surface);
static void
_cairo_xlib_surface_ensure_src_picture (cairo_xlib_surface_t *surface);
static void
_cairo_xlib_surface_ensure_dst_picture (cairo_xlib_surface_t *surface);
@@ -76,16 +66,20 @@ _native_byte_order_lsb (void);
static cairo_int_status_t
_cairo_xlib_surface_show_glyphs (void *abstract_dst,
cairo_operator_t op,
cairo_pattern_t *src_pattern,
cairo_glyph_t *glyphs,
int num_glyphs,
cairo_scaled_font_t *scaled_font);
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+slim_hidden_proto (cairo_xlib_surface_create_with_xrender_format);
+#endif
+
/*
* Instead of taking two round trips for each blending request,
* assume that if a particular drawable fails GetImage that it will
* fail for a "while"; use temporary pixmaps to avoid the errors
*/
#define CAIRO_ASSUME_PIXMAP 20
@@ -174,21 +168,19 @@ _cairo_xlib_surface_create_similar_with_
return NULL;
}
pix = XCreatePixmap (dpy, src->drawable,
width <= 0 ? 1 : width, height <= 0 ? 1 : height,
depth);
surface = (cairo_xlib_surface_t *)
- _cairo_xlib_surface_create_internal (dpy, pix,
- src->screen, src->visual,
- xrender_format,
- width, height,
- depth);
+ cairo_xlib_surface_create_with_xrender_format (dpy, pix, src->screen,
+ xrender_format,
+ width, height);
if (surface->base.status) {
XFreePixmap (dpy, pix);
return &surface->base;
}
surface->owns_pixmap = TRUE;
return &surface->base;
@@ -254,21 +246,20 @@ _cairo_xlib_surface_create_similar (void
/* We've got a compatible XRenderFormat now, which means the
* similar surface will match the existing surface as closely in
* visual/depth etc. as possible. */
pix = XCreatePixmap (src->dpy, src->drawable,
width <= 0 ? 1 : width, height <= 0 ? 1 : height,
xrender_format->depth);
surface = (cairo_xlib_surface_t *)
- _cairo_xlib_surface_create_internal (src->dpy, pix,
- src->screen, src->visual,
- xrender_format,
- width, height,
- xrender_format->depth);
+ cairo_xlib_surface_create_with_xrender_format (src->dpy, pix,
+ src->screen,
+ xrender_format,
+ width, height);
if (surface->base.status != CAIRO_STATUS_SUCCESS) {
XFreePixmap (src->dpy, pix);
return &surface->base;
}
surface->owns_pixmap = TRUE;
return &surface->base;
@@ -2396,16 +2387,17 @@ cairo_xlib_surface_create_with_xrender_f
Screen *screen,
XRenderPictFormat *format,
int width,
int height)
{
return _cairo_xlib_surface_create_internal (dpy, drawable, screen,
NULL, format, width, height, 0);
}
+slim_hidden_def (cairo_xlib_surface_create_with_xrender_format);
/**
* cairo_xlib_surface_get_xrender_format:
* @surface: an xlib surface
*
* Gets the X Render picture format that @surface uses for rendering with the
* X Render extension. If the surface was created by
* cairo_xlib_surface_create_with_xrender_format() originally, the return