aboutsummaryrefslogtreecommitdiff
path: root/ui/sdl_zoom.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2018-08-22 14:15:54 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-01 11:59:12 +0100
commit0015ca5cbabe0b31d31610ddfaafd90a9e5911a4 (patch)
tree12c61f3568afb0430206e3327caf17525359537e /ui/sdl_zoom.c
parent70cc0c1fb0b7b7bc185ca4a233e215ef44f35913 (diff)
downloadqemu-0015ca5cbabe0b31d31610ddfaafd90a9e5911a4.zip
qemu-0015ca5cbabe0b31d31610ddfaafd90a9e5911a4.tar.gz
qemu-0015ca5cbabe0b31d31610ddfaafd90a9e5911a4.tar.bz2
ui: remove support for SDL1.2 in favour of SDL2
SDL1.2 was deprecated in the 2.12.0 release with: commit e52c6ba34149b4f39c3fd60e59ee32b809db2bfa Author: Daniel P. Berrange <berrange@redhat.com> Date: Mon Jan 15 14:25:33 2018 +0000 ui: deprecate use of SDL 1.2 in favour of 2.0 series The SDL 2.0 release was made in Aug, 2013: https://www.libsdl.org/release/ That will soon be 4 + 1/2 years ago, which is enough time to consider the 2.0 series widely supported. Thus we deprecate the SDL 1.2 support, which will allow us to delete it in the last release of 2018. By this time, SDL 2.0 will be more than 5 years old. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20180115142533.24585-1-berrange@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> It is thus able to be removed in the 3.1.0 release. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20180822131554.3398-4-berrange@redhat.com> [ kraxel: rebase ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/sdl_zoom.c')
-rw-r--r--ui/sdl_zoom.c93
1 files changed, 0 insertions, 93 deletions
diff --git a/ui/sdl_zoom.c b/ui/sdl_zoom.c
deleted file mode 100644
index b96196b..0000000
--- a/ui/sdl_zoom.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * SDL_zoom - surface scaling
- *
- * Copyright (c) 2009 Citrix Systems, Inc.
- *
- * Derived from: SDL_rotozoom, LGPL (c) A. Schiffler from the SDL_gfx library.
- * Modifications by Stefano Stabellini.
- *
- * This work is licensed under the terms of the GNU GPL version 2.
- * See the COPYING file in the top-level directory.
- *
- */
-
-#include "qemu/osdep.h"
-#include "sdl_zoom.h"
-
-static void sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth,
- SDL_Rect *dst_rect);
-static void sdl_zoom_rgb32(SDL_Surface *src, SDL_Surface *dst, int smooth,
- SDL_Rect *dst_rect);
-
-#define BPP 32
-#include "sdl_zoom_template.h"
-#undef BPP
-#define BPP 16
-#include "sdl_zoom_template.h"
-#undef BPP
-
-int sdl_zoom_blit(SDL_Surface *src_sfc, SDL_Surface *dst_sfc, int smooth,
- SDL_Rect *in_rect)
-{
- SDL_Rect zoom, src_rect;
- int extra;
-
- /* Grow the size of the modified rectangle to avoid edge artefacts */
- src_rect.x = (in_rect->x > 0) ? (in_rect->x - 1) : 0;
- src_rect.y = (in_rect->y > 0) ? (in_rect->y - 1) : 0;
-
- src_rect.w = in_rect->w + 1;
- if (src_rect.x + src_rect.w > src_sfc->w)
- src_rect.w = src_sfc->w - src_rect.x;
-
- src_rect.h = in_rect->h + 1;
- if (src_rect.y + src_rect.h > src_sfc->h)
- src_rect.h = src_sfc->h - src_rect.y;
-
- /* (x,y) : round down */
- zoom.x = (int)(((float)(src_rect.x * dst_sfc->w)) / (float)(src_sfc->w));
- zoom.y = (int)(((float)(src_rect.y * dst_sfc->h)) / (float)(src_sfc->h));
-
- /* (w,h) : round up */
- zoom.w = (int)( ((double)((src_rect.w * dst_sfc->w) + (src_sfc->w - 1))) /
- (double)(src_sfc->w));
-
- zoom.h = (int)( ((double)((src_rect.h * dst_sfc->h) + (src_sfc->h - 1))) /
- (double)(src_sfc->h));
-
- /* Account for any (x,y) rounding by adding one-source-pixel's worth
- * of destination pixels and then edge checking.
- */
-
- extra = ((dst_sfc->w-1) / src_sfc->w) + 1;
-
- if ((zoom.x + zoom.w) < (dst_sfc->w - extra))
- zoom.w += extra;
- else
- zoom.w = dst_sfc->w - zoom.x;
-
- extra = ((dst_sfc->h-1) / src_sfc->h) + 1;
-
- if ((zoom.y + zoom.h) < (dst_sfc->h - extra))
- zoom.h += extra;
- else
- zoom.h = dst_sfc->h - zoom.y;
-
- /* The rectangle (zoom.x, zoom.y, zoom.w, zoom.h) is the area on the
- * destination surface that needs to be updated.
- */
- if (src_sfc->format->BitsPerPixel == 32)
- sdl_zoom_rgb32(src_sfc, dst_sfc, smooth, &zoom);
- else if (src_sfc->format->BitsPerPixel == 16)
- sdl_zoom_rgb16(src_sfc, dst_sfc, smooth, &zoom);
- else {
- fprintf(stderr, "pixel format not supported\n");
- return -1;
- }
-
- /* Return the rectangle of the update to the caller */
- *in_rect = zoom;
-
- return 0;
-}
-