Commit ab8fd100 authored by Søren Sandmann Pedersen's avatar Søren Sandmann Pedersen Committed by Søren Sandmann Pedersen

Tiled upload of images after software fallback.

Instead of uploading the full software image in one go, upload it in
512x512 tiles to avoid having to find huge huge blocks of memory and
potentially running out.
parent 81e3d5c1
......@@ -1024,7 +1024,7 @@ translate_rect (struct QXLRect *rect)
}
static void
upload_box (qxl_surface_t *surface, int x1, int y1, int x2, int y2)
real_upload_box (qxl_surface_t *surface, int x1, int y1, int x2, int y2)
{
struct QXLRect rect;
struct QXLDrawable *drawable;
......@@ -1060,6 +1060,31 @@ upload_box (qxl_surface_t *surface, int x1, int y1, int x2, int y2)
push_drawable (qxl, drawable);
}
#define TILE_WIDTH 512
#define TILE_HEIGHT 512
static void
upload_box (qxl_surface_t *surface, int x1, int y1, int x2, int y2)
{
int tile_x1, tile_y1;
for (tile_y1 = y1; tile_y1 < y2; tile_y1 += TILE_HEIGHT)
{
for (tile_x1 = x1; tile_x1 < x2; tile_x1 += TILE_WIDTH)
{
int tile_x2 = tile_x1 + TILE_WIDTH;
int tile_y2 = tile_y1 + TILE_HEIGHT;
if (tile_x2 > x2)
tile_x2 = x2;
if (tile_y2 > y2)
tile_y2 = y2;
real_upload_box (surface, tile_x1, tile_y1, tile_x2, tile_y2);
}
}
}
void
qxl_surface_finish_access (qxl_surface_t *surface, PixmapPtr pixmap)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment