diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2018-02-16 15:55:45 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2018-02-16 15:55:45 +0000 |
| commit | 5e8d6a12d643a38b82a0a713a77d1192117dbdca (patch) | |
| tree | 86e5b8826acbcdfdaa91d5b51ddbfc9692236a1c /ui/sdl2-2d.c | |
| parent | d9c92ae335d99dd32c52fc7b075ef4820b4c6571 (diff) | |
| parent | d50f09ff23f5509c05e3883440849b27af051f08 (diff) | |
| download | focaccia-qemu-5e8d6a12d643a38b82a0a713a77d1192117dbdca.tar.gz focaccia-qemu-5e8d6a12d643a38b82a0a713a77d1192117dbdca.zip | |
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180216-pull-request' into staging
bugfixes for vnc and sdl2 # gpg: Signature made Fri 16 Feb 2018 11:53:37 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/ui-20180216-pull-request: ui: extend VNC trottling tracing to SASL codepaths ui: check VNC audio frequency limit at time of reading from client ui: avoid 'local_err' variable shadowing in VNC SASL auth ui: avoid risk of 32-bit int overflow in VNC buffer check sdl2: fix mouse grab sdl: restore optimized redraw vnc: fix segfault in closed connection handling vnc: add qapi/error.h include to stubs vnc: remove bogus object_unref on client socket Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/sdl2-2d.c')
| -rw-r--r-- | ui/sdl2-2d.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c index 8ab68d67b9..1f34817bae 100644 --- a/ui/sdl2-2d.c +++ b/ui/sdl2-2d.c @@ -36,6 +36,8 @@ void sdl2_2d_update(DisplayChangeListener *dcl, struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl); DisplaySurface *surf = qemu_console_surface(dcl->con); SDL_Rect rect; + size_t surface_data_offset = surface_bytes_per_pixel(surf) * x + + surface_stride(surf) * y; assert(!scon->opengl); @@ -46,27 +48,16 @@ void sdl2_2d_update(DisplayChangeListener *dcl, return; } - /* - * SDL2 seems to do some double-buffering, and trying to only - * update the changed areas results in only one of the two buffers - * being updated. Which flickers alot. So lets not try to be - * clever do a full update every time ... - */ -#if 0 rect.x = x; rect.y = y; rect.w = w; rect.h = h; -#else - rect.x = 0; - rect.y = 0; - rect.w = surface_width(surf); - rect.h = surface_height(surf); -#endif - - SDL_UpdateTexture(scon->texture, NULL, surface_data(surf), + + SDL_UpdateTexture(scon->texture, &rect, + surface_data(surf) + surface_data_offset, surface_stride(surf)); - SDL_RenderCopy(scon->real_renderer, scon->texture, &rect, &rect); + SDL_RenderClear(scon->real_renderer); + SDL_RenderCopy(scon->real_renderer, scon->texture, NULL, NULL); SDL_RenderPresent(scon->real_renderer); } |