From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPs3G-0006vt-5f for qemu-devel@nongnu.org; Fri, 05 Sep 2014 07:51:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPs36-0003cy-A7 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 07:51:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPs36-0003cg-1I for qemu-devel@nongnu.org; Fri, 05 Sep 2014 07:51:28 -0400 From: Gerd Hoffmann Date: Fri, 5 Sep 2014 13:51:15 +0200 Message-Id: <1409917876-21961-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1409917876-21961-1-git-send-email-kraxel@redhat.com> References: <1409917876-21961-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 7/8] console: add qemu_pixman_linebuf_copy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori Helper function for copying data from linebuf to framebuffer using pixman, possibly converting in case src and dst formats differ. Signed-off-by: Gerd Hoffmann --- include/ui/qemu-pixman.h | 2 ++ ui/qemu-pixman.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/ui/qemu-pixman.h b/include/ui/qemu-pixman.h index 80ed94a..381969d 100644 --- a/include/ui/qemu-pixman.h +++ b/include/ui/qemu-pixman.h @@ -42,6 +42,8 @@ pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format, int width); void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb, int width, int x, int y); +void qemu_pixman_linebuf_copy(pixman_image_t *fb, int width, int x, int y, + pixman_image_t *linebuf); pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format, pixman_image_t *image); void qemu_pixman_image_unref(pixman_image_t *image); diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c index 5d8bd46..30c7fdd 100644 --- a/ui/qemu-pixman.c +++ b/ui/qemu-pixman.c @@ -133,6 +133,7 @@ pixman_image_t *qemu_pixman_linebuf_create(pixman_format_code_t format, return image; } +/* fill linebuf from framebuffer */ void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb, int width, int x, int y) { @@ -140,6 +141,14 @@ void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb, x, y, 0, 0, 0, 0, width, 1); } +/* copy linebuf to framebuffer */ +void qemu_pixman_linebuf_copy(pixman_image_t *fb, int width, int x, int y, + pixman_image_t *linebuf) +{ + pixman_image_composite(PIXMAN_OP_SRC, linebuf, NULL, fb, + 0, 0, 0, 0, x, y, width, 1); +} + pixman_image_t *qemu_pixman_mirror_create(pixman_format_code_t format, pixman_image_t *image) { -- 1.8.3.1