From: Stanislav Vorobiov Date: Tue, 27 Aug 2013 10:47:21 +0000 (+0400) Subject: VIGS: Make a single memcpy call inside vigs_server_update_display when possible X-Git-Tag: TizenStudio_2.0_p2.3~657 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=561fe52b2de365f7e67abf359f71bd44e79ad0e8;p=sdk%2Femulator%2Fqemu.git VIGS: Make a single memcpy call inside vigs_server_update_display when possible If display stride == root surface stride one memcpy will suffice --- diff --git a/hw/vigs_server.c b/hw/vigs_server.c index c48c45c..2783da0 100644 --- a/hw/vigs_server.c +++ b/hw/vigs_server.c @@ -479,21 +479,36 @@ void vigs_server_update_display(struct vigs_server *server) exit(1); } - for (i = 0; i < root_sfc->ws_sfc->height; ++i) { - uint8_t *src = sfc_data; - uint8_t *dst = display_data; - + if (display_stride == root_sfc->stride) { switch (root_sfc->format) { case vigsp_surface_bgrx8888: case vigsp_surface_bgra8888: - memcpy(dst, src, root_sfc->ws_sfc->width * 4); + memcpy(display_data, + sfc_data, + root_sfc->ws_sfc->height * display_stride); break; default: assert(false); VIGS_LOG_CRITICAL("unknown format: %d", root_sfc->format); exit(1); } - sfc_data += root_sfc->stride; - display_data += display_stride; + } else { + for (i = 0; i < root_sfc->ws_sfc->height; ++i) { + uint8_t *src = sfc_data; + uint8_t *dst = display_data; + + switch (root_sfc->format) { + case vigsp_surface_bgrx8888: + case vigsp_surface_bgra8888: + memcpy(dst, src, root_sfc->ws_sfc->width * 4); + break; + default: + assert(false); + VIGS_LOG_CRITICAL("unknown format: %d", root_sfc->format); + exit(1); + } + sfc_data += root_sfc->stride; + display_data += display_stride; + } } }