static void invalidate(SpiceChannel *channel,
                       gint x, gint y, gint w, gint h, gpointer data) {
    SpiceDisplay *display = data;

    if (!do_color_convert(display, x, y, w, h))
        return;

    SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);

	if (x + w > d->width || y + h > d->height) {
		__android_log_write(6, "android-spice", "Not drawing.");
	} else {
	    uiCallbackInvalidate (d, x, y, w, h);
	}
}
void spice_display_invalidate(SpiceDisplay *display) {
    SpiceDisplayPrivate *d = SPICE_DISPLAY_GET_PRIVATE(display);
    uiCallbackInvalidate(d->ctx, 0, 0, d->width, d->height);
}