mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-06 16:40:19 +01:00
Fix image data length computation (XCB doesn't do this part).
This commit is contained in:
parent
1e72b87b93
commit
5230af4e5a
3 changed files with 10 additions and 4 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2004-06-16 Keith Packard <keithp@keithp.com>
|
||||
|
||||
* src/cairo_xcb_surface.c: (bytes_per_line),
|
||||
(_cairo_xcb_surface_set_image):
|
||||
Fix image data length computation (XCB doesn't do this part).
|
||||
|
||||
2004-06-11 David Reveman <c99drn@cs.umu.se>
|
||||
|
||||
* configure.in: Require glitz 0.1.4.
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ static int
|
|||
bytes_per_line(XCBConnection *c, int width, int bpp)
|
||||
{
|
||||
int bitmap_pad = XCBGetSetup(c)->bitmap_format_scanline_pad;
|
||||
return (bpp * width + bitmap_pad - 1) & -bitmap_pad;
|
||||
return ((bpp * width + bitmap_pad - 1) & -bitmap_pad) >> 3;
|
||||
}
|
||||
|
||||
static cairo_image_surface_t *
|
||||
|
|
@ -401,7 +401,7 @@ _cairo_xcb_surface_set_image (void *abstract_surface,
|
|||
|
||||
_cairo_xcb_surface_ensure_gc (surface);
|
||||
bpp = bits_per_pixel(surface->dpy, image->depth);
|
||||
data_len = bytes_per_line(surface->dpy, surface->width, bpp) * surface->height;
|
||||
data_len = bytes_per_line(surface->dpy, image->width, bpp) * image->height;
|
||||
XCBPutImage(surface->dpy, ZPixmap, surface->drawable, surface->gc,
|
||||
image->width,
|
||||
image->height,
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ static int
|
|||
bytes_per_line(XCBConnection *c, int width, int bpp)
|
||||
{
|
||||
int bitmap_pad = XCBGetSetup(c)->bitmap_format_scanline_pad;
|
||||
return (bpp * width + bitmap_pad - 1) & -bitmap_pad;
|
||||
return ((bpp * width + bitmap_pad - 1) & -bitmap_pad) >> 3;
|
||||
}
|
||||
|
||||
static cairo_image_surface_t *
|
||||
|
|
@ -401,7 +401,7 @@ _cairo_xcb_surface_set_image (void *abstract_surface,
|
|||
|
||||
_cairo_xcb_surface_ensure_gc (surface);
|
||||
bpp = bits_per_pixel(surface->dpy, image->depth);
|
||||
data_len = bytes_per_line(surface->dpy, surface->width, bpp) * surface->height;
|
||||
data_len = bytes_per_line(surface->dpy, image->width, bpp) * image->height;
|
||||
XCBPutImage(surface->dpy, ZPixmap, surface->drawable, surface->gc,
|
||||
image->width,
|
||||
image->height,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue