From: giwoong.kim Date: Tue, 7 Aug 2012 07:47:31 +0000 (+0900) Subject: [Title] sdl_rotozoom was replaced by maru_rotozoom X-Git-Tag: TizenStudio_2.0_p2.3~1396^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3bf4c1357ab68eb3a65937bd5296c031c5832ef7;p=sdk%2Femulator%2Fqemu.git [Title] sdl_rotozoom was replaced by maru_rotozoom [Type] feature [Module] Emulator / skin [Priority] major [Jira#] [Redmine#] [Problem] [Cause] anti-aliasing [Solution] [TestCase] --- diff --git a/tizen/src/maru_sdl.c b/tizen/src/maru_sdl.c index aeeff69..f7ed385 100644 --- a/tizen/src/maru_sdl.c +++ b/tizen/src/maru_sdl.c @@ -29,6 +29,7 @@ #include +#include #include "console.h" #include "maru_sdl.h" #include "emul_state.h" @@ -348,18 +349,18 @@ static void qemu_update(void) { //sdl surface SDL_Surface *processing_screen = NULL; - if (current_scale_factor <= 0.5) { - /* zoom filter : c00 c0-1 c01 c-10 c10 */ - processing_screen = maru_rotozoom(surface_qemu, (int)current_screen_degree, current_scale_factor); - SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL); - } else if (current_scale_factor != 1.0 || current_screen_degree != 0.0) { + if (current_scale_factor < 0.5) { // workaround // set color key 'magenta' surface_qemu->format->colorkey = 0xFF00FF; - /* zoom filter : c00 c01 c10 c11 */ + //image processing processing_screen = rotozoomSurface(surface_qemu, current_screen_degree, current_scale_factor, 1); SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL); + } else if (current_scale_factor != 1.0 || current_screen_degree != 0.0) { + //image processing + processing_screen = maru_rotozoom(surface_qemu, (int)current_screen_degree, current_scale_factor); + SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL); } else { //as-is SDL_BlitSurface(surface_qemu, NULL, surface_screen, NULL); } diff --git a/tizen/src/maru_sdl_rotozoom.h b/tizen/src/maru_sdl_rotozoom.h index 7f7888d..4faf2c4 100644 --- a/tizen/src/maru_sdl_rotozoom.h +++ b/tizen/src/maru_sdl_rotozoom.h @@ -105,9 +105,9 @@ static void interpolate_pixel_cpy(unsigned int *dst, unsigned int *src_addr, uns unsigned int sum_b = 0; //0x000000ff unsigned int c00 = (x * src_w) + y; - unsigned int c01 = (y + 1 > src_w) ? c00 : c00 + 1; - unsigned int c10 = (x + 1 > src_h) ? c00 : ((x + 1) * src_w) + y; - unsigned int c11 = (y + 1 > src_w) ? c00 : c10 + 1; + unsigned int c01 = (y + 1 >= src_w) ? c00 : c00 + 1; + unsigned int c10 = (x + 1 >= src_h) ? c00 : ((x + 1) * src_w) + y; + unsigned int c11 = (y + 1 >= src_w) ? c00 : c10 + 1; sum_r = (src_addr[c00] & R_CHANNEL_MASK) + (src_addr[c01] & R_CHANNEL_MASK) + (src_addr[c10] & R_CHANNEL_MASK) + (src_addr[c11] & R_CHANNEL_MASK);