diff options
author | Bogdan Seniuc <me@bogdacutu.me> | 2015-01-23 17:22:39 +0100 |
---|---|---|
committer | Dees Troy <dees_troy@teamw.in> | 2015-01-30 04:32:34 +0100 |
commit | d1372f732c364796c5039db3ed06c16fabd731a6 (patch) | |
tree | 18065db22833f0364ee1d3537b1bb37e6bfc56e9 | |
parent | gui: fix IsInRegion (diff) | |
download | android_bootable_recovery-d1372f732c364796c5039db3ed06c16fabd731a6.tar android_bootable_recovery-d1372f732c364796c5039db3ed06c16fabd731a6.tar.gz android_bootable_recovery-d1372f732c364796c5039db3ed06c16fabd731a6.tar.bz2 android_bootable_recovery-d1372f732c364796c5039db3ed06c16fabd731a6.tar.lz android_bootable_recovery-d1372f732c364796c5039db3ed06c16fabd731a6.tar.xz android_bootable_recovery-d1372f732c364796c5039db3ed06c16fabd731a6.tar.zst android_bootable_recovery-d1372f732c364796c5039db3ed06c16fabd731a6.zip |
-rw-r--r-- | minuitwrp/graphics.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c index 512a95716..93123e40a 100644 --- a/minuitwrp/graphics.c +++ b/minuitwrp/graphics.c @@ -351,20 +351,18 @@ void gr_flip(void) /* flip buffer 180 degrees for devices with physicaly inverted screens */ unsigned int i; unsigned int j; - uint8_t tmp; - for (i = 0; i < ((vi.xres_virtual * vi.yres)/2); i++) { - for (j = 0; j < PIXEL_SIZE; j++) { - tmp = gr_mem_surface.data[i * PIXEL_SIZE + j]; - gr_mem_surface.data[i * PIXEL_SIZE + j] = gr_mem_surface.data[(vi.xres_virtual * vi.yres * PIXEL_SIZE) - ((i+1) * PIXEL_SIZE) + j]; - gr_mem_surface.data[(vi.xres_virtual * vi.yres * PIXEL_SIZE) - ((i+1) * PIXEL_SIZE) + j] = tmp; + for (i = 0; i < vi.yres; i++) { + for (j = 0; j < vi.xres; j++) { + memcpy(gr_framebuffer[gr_active_fb].data + (i * vi.xres_virtual + j) * PIXEL_SIZE, + gr_mem_surface.data + ((vi.yres - i - 1) * vi.xres_virtual + vi.xres - j - 1) * PIXEL_SIZE, PIXEL_SIZE); } } -#endif - +#else /* copy data from the in-memory surface to the buffer we're about * to make active. */ memcpy(gr_framebuffer[gr_active_fb].data, gr_mem_surface.data, vi.xres_virtual * vi.yres * PIXEL_SIZE); +#endif /* inform the display driver */ set_active_framebuffer(gr_active_fb); |