summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-02-11 19:38:40 +0100
committerBenjamin Otte <otte@redhat.com>2010-04-23 23:30:08 +0200
commitbf921f41abe3af37b3e0f951ccd9d5199a042068 (patch)
treeee77da6881a82850e1e78d3a7e168539b8a26a2c
parent16c9198347e874dcc38c35d1f5832ee0e70062a3 (diff)
xcb: Make work with removal of data/stride
As there's no fallback code, no attempt was made to fix it.
-rw-r--r--src/cairo-xcb-surface-core.c11
-rw-r--r--src/cairo-xcb-surface-render.c22
-rw-r--r--src/cairo-xcb-surface.c12
3 files changed, 23 insertions, 22 deletions
diff --git a/src/cairo-xcb-surface-core.c b/src/cairo-xcb-surface-core.c
index 3cc167ee..b25e876d 100644
--- a/src/cairo-xcb-surface-core.c
+++ b/src/cairo-xcb-surface-core.c
@@ -238,25 +238,24 @@ _pixmap_from_image (cairo_xcb_surface_t *target,
/* Do we need to trim the image? */
len = CAIRO_STRIDE_FOR_WIDTH_BPP (image->width,
PIXMAN_FORMAT_BPP (image->pixman_format));
- if (len == image->stride) {
+ if (len == pixman_image_get_stride (image->pixman_image)) {
_cairo_xcb_connection_put_image (target->connection,
pixmap->pixmap, gc,
image->width, image->height,
0, 0,
image->depth,
- image->stride,
- image->data);
+ pixman_image_get_stride (image->pixman_image),
+ pixman_image_get_data (image->pixman_image));
} else {
_cairo_xcb_connection_put_subimage (target->connection,
pixmap->pixmap, gc,
0, 0,
image->width, image->height,
PIXMAN_FORMAT_BPP (image->pixman_format) / 8,
- image->stride,
+ pixman_image_get_stride (image->pixman_image),
0, 0,
image->depth,
- image->data);
-
+ pixman_image_get_data (image->pixman_image));
}
}
diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index 9cd51f8a..4301c14e 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -330,24 +330,24 @@ _picture_from_image (cairo_xcb_surface_t *target,
/* Do we need to trim the image? */
len = CAIRO_STRIDE_FOR_WIDTH_BPP (image->width, PIXMAN_FORMAT_BPP (image->pixman_format));
- if (len == image->stride) {
+ if (len == pixman_image_get_stride (image->pixman_image)) {
_cairo_xcb_connection_put_image (target->connection,
pixmap, gc,
image->width, image->height,
0, 0,
image->depth,
- image->stride,
- image->data);
+ pixman_image_get_stride (image->pixman_image),
+ pixman_image_get_data (image->pixman_image));
} else {
_cairo_xcb_connection_put_subimage (target->connection,
pixmap, gc,
0, 0,
image->width, image->height,
PIXMAN_FORMAT_BPP (image->pixman_format) / 8,
- image->stride,
+ pixman_image_get_stride (image->pixman_image),
0, 0,
image->depth,
- image->data);
+ pixman_image_get_data (image->pixman_image));
}
}
@@ -3178,7 +3178,7 @@ static void
_clear_image (cairo_surface_t *surface)
{
cairo_image_surface_t *image = (cairo_image_surface_t *) surface;
- memset (image->data, 0, image->stride * image->height);
+ memset (pixman_image_get_data (image->pixman_image), 0, pixman_image_get_stride (image->pixman_image) * image->height);
surface->is_clear = TRUE;
}
@@ -4022,14 +4022,14 @@ _cairo_xcb_surface_add_glyph (cairo_xcb_connection_t *connection,
glyph_info.x_off = scaled_glyph->x_advance;
glyph_info.y_off = scaled_glyph->y_advance;
- data = glyph_surface->data;
+ data = pixman_image_get_data (glyph_surface->pixman_image);
/* flip formats around */
switch (_cairo_xcb_get_glyphset_index_for_format (scaled_glyph->surface->format)) {
case GLYPHSET_INDEX_A1:
/* local bitmaps are always stored with bit == byte */
if (_native_byte_order_lsb() != (connection->root->bitmap_format_bit_order == XCB_IMAGE_ORDER_LSB_FIRST)) {
- int c = glyph_surface->stride * glyph_surface->height;
+ int c = pixman_image_get_stride (glyph_surface->pixman_image) * glyph_surface->height;
const uint8_t *d;
uint8_t *new, *n;
@@ -4057,7 +4057,7 @@ _cairo_xcb_surface_add_glyph (cairo_xcb_connection_t *connection,
case GLYPHSET_INDEX_ARGB32:
if (_native_byte_order_lsb() != (connection->root->image_byte_order == XCB_IMAGE_ORDER_LSB_FIRST)) {
- unsigned int c = glyph_surface->stride * glyph_surface->height / 4;
+ unsigned int c = pixman_image_get_stride (glyph_surface->pixman_image) * glyph_surface->height / 4;
const uint32_t *d;
uint32_t *new, *n;
@@ -4086,10 +4086,10 @@ _cairo_xcb_surface_add_glyph (cairo_xcb_connection_t *connection,
_cairo_xcb_connection_render_add_glyphs (connection,
glyphset_info->glyphset,
1, &glyph_index, &glyph_info,
- glyph_surface->stride * glyph_surface->height,
+ pixman_image_get_stride (glyph_surface->pixman_image) * glyph_surface->height,
data);
- if (data != glyph_surface->data)
+ if (data != (uint8_t *) pixman_image_get_data (glyph_surface->pixman_image))
free (data);
_cairo_xcb_scaled_glyph_set_glyphset_info (scaled_glyph, glyphset_info);
diff --git a/src/cairo-xcb-surface.c b/src/cairo-xcb-surface.c
index 98524238..90a91603 100644
--- a/src/cairo-xcb-surface.c
+++ b/src/cairo-xcb-surface.c
@@ -378,7 +378,9 @@ _get_shm_image (cairo_xcb_surface_t *surface,
if (unlikely (status))
return status;
} else {
- memset (image->data, 0, image->stride * image->height);
+ memset (pixman_image_get_data (image->pixman_image),
+ 0,
+ pixman_image_get_stride (image->pixman_image) * image->height);
}
*image_out = image;
@@ -505,7 +507,7 @@ _get_image (cairo_xcb_surface_t *surface,
goto FAIL;
}
- assert (xcb_get_image_data_length (reply) == image->height * image->stride);
+ assert (xcb_get_image_data_length (reply) == image->height * pixman_image_get_stride (image->pixman_image));
pixman_image_set_destroy_function (image->pixman_image, _destroy_image, reply);
@@ -655,7 +657,7 @@ _put_image (cairo_xcb_surface_t *surface,
assert (image->width == surface->width);
assert (image->height == surface->height);
assert (image->depth == surface->depth);
- assert (image->stride == (int) CAIRO_STRIDE_FOR_WIDTH_BPP (image->width, PIXMAN_FORMAT_BPP (image->pixman_format)));
+ assert (pixman_image_get_stride (image->pixman_image) == (int) CAIRO_STRIDE_FOR_WIDTH_BPP (image->width, PIXMAN_FORMAT_BPP (image->pixman_format)));
gc = _cairo_xcb_screen_get_gc (surface->screen,
surface->drawable,
@@ -668,8 +670,8 @@ _put_image (cairo_xcb_surface_t *surface,
image->width, image->height,
0, 0,
image->depth,
- image->stride,
- image->data);
+ pixman_image_get_stride (image->pixman_image),
+ pixman_image_get_data (image->pixman_image));
status = CAIRO_STATUS_SUCCESS;
}