summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-11-26 10:45:26 +1000
committerDave Airlie <airlied@redhat.com>2013-11-26 10:45:26 +1000
commita22cf06968d0bbeea4784fa3bf69628a9cbf1397 (patch)
tree8736bb3ab6e2132c26eba46678506909966b2da5
parent170d3e3af3adb0de38d1980b0f85618a15a16bb2 (diff)
worst hack of all time to qxl driverhack-the-streamer
-rw-r--r--src/qxl_surface.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 1075eae..561b416 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -759,8 +759,9 @@ qxl_surface_composite (qxl_surface_t *dest,
qxl->bo_funcs->bo_decref(qxl, derefs[i]);
}
-Bool
-qxl_surface_put_image (qxl_surface_t *dest,
+
+static Bool
+qxl_surface_put_image_for_reals (qxl_surface_t *dest,
int x, int y, int width, int height,
const char *src, int src_pitch)
{
@@ -803,6 +804,31 @@ qxl_surface_put_image (qxl_surface_t *dest,
return TRUE;
}
+#define HACK_THE_PLANET 1
+Bool
+qxl_surface_put_image (qxl_surface_t *dest,
+ int x, int y, int width, int height,
+ const char *src, int src_pitch)
+{
+#ifdef HACK_THE_PLANET
+ Bool use_hack = FALSE;
+
+ /* worst heuristic ever - should really block the gnome-shell issue for now */
+ if (width == pixman_image_get_width(dest->host_image) && height < pixman_image_get_height(dest->host_image))
+ use_hack = TRUE;
+
+ if (use_hack) {
+ int gross = rand() % height;
+ int h2 = height - gross;
+ if (gross > 0)
+ qxl_surface_put_image_for_reals(dest, x, y, width, gross, src, src_pitch);
+ qxl_surface_put_image_for_reals(dest, x, y + gross, width, h2, src + (gross * src_pitch), src_pitch);
+ return TRUE;
+ } else
+#endif
+ return qxl_surface_put_image_for_reals(dest, x, y, width, height, src, src_pitch);
+}
+
void
qxl_get_formats (int bpp, SpiceSurfaceFmt *format, pixman_format_code_t *pformat)
{