From: jinhyung.jo Date: Tue, 7 May 2013 08:48:00 +0000 (+0900) Subject: display : Modified to avoid to appear a white region when screen is rotated or scaled... X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~979^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ca8961f04948cdc13c2a245555b266989974fc4;p=sdk%2Femulator%2Fqemu.git display : Modified to avoid to appear a white region when screen is rotated or scaled up/down while powered off. draw ten more blank screen when the skin is rotated or scaled up/down while powered off. Signed-off-by: Jinhyung Jo --- diff --git a/tizen/src/hw/maru_vga.c b/tizen/src/hw/maru_vga.c index ca0d5b78e5..c1991a46a9 100644 --- a/tizen/src/hw/maru_vga.c +++ b/tizen/src/hw/maru_vga.c @@ -1418,34 +1418,16 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) } } - - if ( brightness_off ) { - - dst_sub = s->ds->surface->data + addr; - dst = (uint32_t*) ( s->ds->surface->data + addr ); - - for ( i = 0; i < disp_width; i++, dst_sub += 4, dst++ ) { - *dst = 0xFF000000; // black - } - - } else { - - if ( brightness_level < BRIGHTNESS_MAX ) { - - alpha = brightness_tbl[brightness_level]; - - dst_sub = s->ds->surface->data + addr; - dst = (uint32_t*) ( s->ds->surface->data + addr ); - - for ( i = 0; i < disp_width; i++, dst_sub += 4, dst++ ) { - *dst = ( ( alpha * dst_sub[0] ) >> 8 ) - | ( ( alpha * dst_sub[1] ) & 0xFF00 ) - | ( ( ( alpha * dst_sub[2] ) & 0xFF00 ) << 8 ); - } + if (brightness_level < BRIGHTNESS_MAX) { + alpha = brightness_tbl[brightness_level]; + dst_sub = ds_get_data(s->ds) + addr; + dst = (uint32_t *)(ds_get_data(s->ds) + addr); + for (i = 0; i < disp_width; i++, dst_sub += 4, dst++) { + *dst = ((alpha * dst_sub[0])>> 8) + | ((alpha * dst_sub[1]) & 0xFF00) + | (((alpha * dst_sub[2]) & 0xFF00) << 8); } - } - #endif /* MARU_VGA */ } else { @@ -1538,6 +1520,11 @@ static void vga_update_display(void *opaque) s->cursor_blink_time = qemu_get_clock_ms(vm_clock); full_update = 1; } + if (brightness_off) { + full_update = 1; + vga_draw_blank(s, full_update); + return; + } switch(graphic_mode) { case GMODE_TEXT: vga_draw_text(s, full_update); diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index b561c4a10d..ce34f00350 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -172,6 +172,7 @@ static int maru_sdl_poll_event(SDL_Event *ev) void qemu_ds_sdl_refresh(DisplayState *ds) { SDL_Event ev1, *ev = &ev1; + static uint32_t sdl_skip_count = 0; // surface may be NULL in init func. qemu_display_surface = ds->surface; @@ -185,8 +186,8 @@ void qemu_ds_sdl_refresh(DisplayState *ds) maruskin_sdl_init(0, get_emul_lcd_width(), get_emul_lcd_height(), true); pthread_mutex_unlock(&sdl_mutex); - vga_hw_invalidate(); sdl_skip_update = 0; + sdl_skip_count = 0; break; } @@ -203,11 +204,16 @@ void qemu_ds_sdl_refresh(DisplayState *ds) /* Usually, continuously updated. When the LCD is turned off, - once updates the screen for a black screen. */ + ten more updates the screen for a black screen. */ vga_hw_update(); if (brightness_off) { - sdl_skip_update = 1; + if (++sdl_skip_count > 10) { + sdl_skip_update = 1; + } else { + sdl_skip_update = 0; + } } else { + sdl_skip_count = 0; sdl_skip_update = 0; } diff --git a/tizen/src/maru_shm.c b/tizen/src/maru_shm.c index 7b33c747fd..3204e7532c 100644 --- a/tizen/src/maru_shm.c +++ b/tizen/src/maru_shm.c @@ -46,6 +46,7 @@ static void *shared_memory = (void*) 0; static int skin_shmid; static int shm_skip_update; +static int shm_skip_count; extern pthread_mutex_t mutex_draw_display; extern int draw_display_state; @@ -91,6 +92,7 @@ void qemu_ds_shm_resize(DisplayState *ds) TRACE("qemu_ds_shm_resize\n"); shm_skip_update = 0; + shm_skip_count = 0; } void qemu_ds_shm_refresh(DisplayState *ds) @@ -105,10 +107,15 @@ void qemu_ds_shm_refresh(DisplayState *ds) /* Usually, continuously updated. But when the display is turned off, - just once updates the surface for a black screen. */ + ten more updates the surface for a black screen. */ if (brightness_off) { - shm_skip_update = 1; + if (++shm_skip_count > 10) { + shm_skip_update = 1; + } else { + shm_skip_update = 0; + } } else { + shm_skip_count = 0; shm_skip_update = 0; } }