[mupen64plus-core] 270/310: Merge sdl2_no_surface.patch sdl2_nogetsurface.patch

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:58:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-core.

commit c984f5e34fc291d6edf86e67a123e553ed2d653f
Author: Sven Eckelmann <sven at narfation.org>
Date:   Mon Jan 27 21:16:37 2014 +0100

    Merge sdl2_no_surface.patch sdl2_nogetsurface.patch
---
 debian/patches/sdl2_no_surface.patch   |  98 ++++++++----------------------
 debian/patches/sdl2_nogetsurface.patch | 108 ---------------------------------
 debian/patches/series                  |   1 -
 3 files changed, 26 insertions(+), 181 deletions(-)

diff --git a/debian/patches/sdl2_no_surface.patch b/debian/patches/sdl2_no_surface.patch
index 5dd10c6..565d6c1 100644
--- a/debian/patches/sdl2_no_surface.patch
+++ b/debian/patches/sdl2_no_surface.patch
@@ -8,7 +8,7 @@ Author: Sven Eckelmann <sven at narfation.org>
 
 ---
 diff --git a/src/api/vidext_sdl2_compat.h b/src/api/vidext_sdl2_compat.h
-index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd8dd7d4eb 100644
+index 9c6804082796c250651a94c60cacf7d44e381339..85075e8337f80db881315fd0b5d43489f09f8b46 100644
 --- a/src/api/vidext_sdl2_compat.h
 +++ b/src/api/vidext_sdl2_compat.h
 @@ -21,39 +21,6 @@
@@ -60,17 +60,17 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
  #define SDL_FULLSCREEN      0x00800000
  #define SDL_RESIZABLE       0x01000000
  #define SDL_NOFRAME         0x02000000
-@@ -90,9 +55,6 @@ typedef struct SDL_VideoInfo
+@@ -90,9 +55,7 @@ typedef struct SDL_VideoInfo
  int initialized_video = 0;
  
  static SDL_Window *SDL_VideoWindow = NULL;
 -static SDL_Surface *SDL_WindowSurface = NULL;
--static SDL_Surface *SDL_VideoSurface = NULL;
+ static SDL_Surface *SDL_VideoSurface = NULL;
 -static SDL_Surface *SDL_ShadowSurface = NULL;
  static SDL_Surface *SDL_PublicSurface = NULL;
  static SDL_Rect SDL_VideoViewport;
  static char *wm_title = NULL;
-@@ -209,110 +171,6 @@ SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags)
+@@ -209,110 +172,6 @@ SDL_ListModes(const SDL_PixelFormat * format, Uint32 flags)
  }
  
  static void
@@ -181,7 +181,7 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
  SDL_GL_SwapBuffers(void)
  {
      SDL_GL_SwapWindow(SDL_VideoWindow);
-@@ -321,10 +179,6 @@ SDL_GL_SwapBuffers(void)
+@@ -321,10 +180,6 @@ SDL_GL_SwapBuffers(void)
  static int
  SDL_WM_ToggleFullScreen(SDL_Surface * surface)
  {
@@ -192,7 +192,7 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
      int window_w;
      int window_h;
  
-@@ -333,129 +187,35 @@ SDL_WM_ToggleFullScreen(SDL_Surface * surface)
+@@ -333,19 +188,6 @@ SDL_WM_ToggleFullScreen(SDL_Surface * surface)
          return 0;
      }
  
@@ -212,23 +212,17 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
      /* Do the physical mode switch */
      if (SDL_GetWindowFlags(SDL_VideoWindow) & SDL_WINDOW_FULLSCREEN) {
          if (SDL_SetWindowFullscreen(SDL_VideoWindow, 0) < 0) {
-             return 0;
-         }
--        SDL_PublicSurface->flags &= ~SDL_FULLSCREEN;
-     } else {
-         if (SDL_SetWindowFullscreen(SDL_VideoWindow, 1) < 0) {
-             return 0;
-         }
--        SDL_PublicSurface->flags |= SDL_FULLSCREEN;
--    }
--
+@@ -359,103 +201,24 @@ SDL_WM_ToggleFullScreen(SDL_Surface * surface)
+         SDL_PublicSurface->flags |= SDL_FULLSCREEN;
+     }
+ 
 -    /* Recreate the screen surface */
 -    SDL_WindowSurface = SDL_GetWindowSurface(SDL_VideoWindow);
 -    if (!SDL_WindowSurface) {
 -        /* We're totally hosed... */
 -        return 0;
-     }
- 
+-    }
+-
      /* Center the public surface in the window surface */
      SDL_GetWindowSize(SDL_VideoWindow, &window_w, &window_h);
 -    SDL_VideoViewport.x = (window_w - SDL_VideoSurface->w)/2;
@@ -327,17 +321,7 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
          return -1;
      }
  
-@@ -468,51 +228,12 @@ SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags)
-     if (flags != SDL_VideoFlags) {
-         return -1;
-     }
--    if (bpp != SDL_VideoSurface->format->BitsPerPixel) {
--        return -1;
--    }
--
-     /* Resize the window */
-     SDL_GetWindowSize(SDL_VideoWindow, &w, &h);
-     if (w != width || h != height) {
+@@ -478,40 +241,8 @@ SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags)
          SDL_SetWindowSize(SDL_VideoWindow, width, height);
      }
  
@@ -355,8 +339,8 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
 -    if (SDL_VideoSurface->format != SDL_WindowSurface->format) {
 -        return -1;
 -    }
--    SDL_VideoSurface->w = width;
--    SDL_VideoSurface->h = height;
+     SDL_VideoSurface->w = width;
+     SDL_VideoSurface->h = height;
 -    SDL_VideoSurface->pixels = SDL_WindowSurface->pixels;
 -    SDL_VideoSurface->pitch = SDL_WindowSurface->pitch;
 -    SDL_SetClipRect(SDL_VideoSurface, NULL);
@@ -375,11 +359,10 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
 -    }
 -
 -    ClearVideoSurface();
--
+ 
      return 0;
  }
- 
-@@ -604,6 +325,21 @@ GetEnvironmentWindowPosition(int w, int h, int *x, int *y)
+@@ -604,6 +335,26 @@ GetEnvironmentWindowPosition(int w, int h, int *x, int *y)
      }
  }
  
@@ -387,6 +370,11 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
 +{
 +    /* Destroy existing window */
 +    SDL_PublicSurface = NULL;
++    if (SDL_VideoSurface) {
++        SDL_VideoSurface->flags &= ~SDL_DONTFREE;
++        SDL_FreeSurface(SDL_VideoSurface);
++        SDL_VideoSurface = NULL;
++    }
 +    if (SDL_VideoContext) {
 +        /* SDL_GL_MakeCurrent(0, NULL); *//* Doesn't do anything */
 +        SDL_GL_DeleteContext(SDL_VideoContext);
@@ -401,18 +389,16 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
  static SDL_Surface *
  SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
  {
-@@ -611,10 +347,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
+@@ -611,8 +362,6 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
      int display = GetVideoDisplay();
      int window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(display);
      int window_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(display);
 -    int window_w;
 -    int window_h;
      Uint32 window_flags;
--    Uint32 surface_flags;
+     Uint32 surface_flags;
  
-     if (!initialized_video) {
-         if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
-@@ -641,26 +374,9 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
+@@ -641,26 +390,9 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
      }
  
      /* Destroy existing window */
@@ -441,39 +427,7 @@ index 9c6804082796c250651a94c60cacf7d44e381339..f7fe5d3979e8f86371ded51b67484afd
  
      /* Set up the event filter */
      if (!SDL_GetEventFilter(NULL, NULL)) {
-@@ -691,20 +407,6 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
-     SDL_SetWindowIcon(SDL_VideoWindow, SDL_VideoIcon);
- 
-     window_flags = SDL_GetWindowFlags(SDL_VideoWindow);
--    surface_flags = 0;
--    if (window_flags & SDL_WINDOW_FULLSCREEN) {
--        surface_flags |= SDL_FULLSCREEN;
--    }
--    if ((window_flags & SDL_WINDOW_OPENGL) && (flags & SDL_OPENGL)) {
--        surface_flags |= SDL_OPENGL;
--    }
--    if (window_flags & SDL_WINDOW_RESIZABLE) {
--        surface_flags |= SDL_RESIZABLE;
--    }
--    if (window_flags & SDL_WINDOW_BORDERLESS) {
--        surface_flags |= SDL_NOFRAME;
--    }
--
-     SDL_VideoFlags = flags;
- 
-     /* If we're in OpenGL mode, just create a stub surface and we're done! */
-@@ -716,68 +418,10 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
-         if (SDL_GL_MakeCurrent(SDL_VideoWindow, SDL_VideoContext) < 0) {
-             return NULL;
-         }
--        SDL_VideoSurface =
--            SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, 0, 0, 0, 0, 0);
--        if (!SDL_VideoSurface) {
--            return NULL;
--        }
--        SDL_VideoSurface->flags |= surface_flags;
--        SDL_PublicSurface = SDL_VideoSurface;
-+        SDL_PublicSurface = SDL_GetWindowSurface(SDL_VideoWindow);
+@@ -726,58 +458,6 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
          return SDL_PublicSurface;
      }
  
diff --git a/debian/patches/sdl2_nogetsurface.patch b/debian/patches/sdl2_nogetsurface.patch
deleted file mode 100644
index c630f0f..0000000
--- a/debian/patches/sdl2_nogetsurface.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-Description: Avoid SDL_GetWindowSurface to fix crashes on wayland
- Instead of trying to access the wayland window through SDL_GetWindowSurface,
- it seems to be easier to just use a pseudo surface which is not really used by
- anyone (except the size information).
-Author: Sven Eckelmann <sven at narfation.org>
-
----
-diff --git a/src/api/vidext_sdl2_compat.h b/src/api/vidext_sdl2_compat.h
-index f7fe5d3979e8f86371ded51b67484afd8dd7d4eb..85075e8337f80db881315fd0b5d43489f09f8b46 100644
---- a/src/api/vidext_sdl2_compat.h
-+++ b/src/api/vidext_sdl2_compat.h
-@@ -55,6 +55,7 @@ typedef struct SDL_VideoInfo
- int initialized_video = 0;
- 
- static SDL_Window *SDL_VideoWindow = NULL;
-+static SDL_Surface *SDL_VideoSurface = NULL;
- static SDL_Surface *SDL_PublicSurface = NULL;
- static SDL_Rect SDL_VideoViewport;
- static char *wm_title = NULL;
-@@ -192,10 +193,12 @@ SDL_WM_ToggleFullScreen(SDL_Surface * surface)
-         if (SDL_SetWindowFullscreen(SDL_VideoWindow, 0) < 0) {
-             return 0;
-         }
-+        SDL_PublicSurface->flags &= ~SDL_FULLSCREEN;
-     } else {
-         if (SDL_SetWindowFullscreen(SDL_VideoWindow, 1) < 0) {
-             return 0;
-         }
-+        SDL_PublicSurface->flags |= SDL_FULLSCREEN;
-     }
- 
-     /* Center the public surface in the window surface */
-@@ -228,12 +231,19 @@ SDL_ResizeVideoMode(int width, int height, int bpp, Uint32 flags)
-     if (flags != SDL_VideoFlags) {
-         return -1;
-     }
-+    if (bpp != SDL_VideoSurface->format->BitsPerPixel) {
-+        return -1;
-+    }
-+
-     /* Resize the window */
-     SDL_GetWindowSize(SDL_VideoWindow, &w, &h);
-     if (w != width || h != height) {
-         SDL_SetWindowSize(SDL_VideoWindow, width, height);
-     }
- 
-+    SDL_VideoSurface->w = width;
-+    SDL_VideoSurface->h = height;
-+
-     return 0;
- }
- 
-@@ -329,6 +339,11 @@ static void SDL2_DestroyWindow(void)
- {
-     /* Destroy existing window */
-     SDL_PublicSurface = NULL;
-+    if (SDL_VideoSurface) {
-+        SDL_VideoSurface->flags &= ~SDL_DONTFREE;
-+        SDL_FreeSurface(SDL_VideoSurface);
-+        SDL_VideoSurface = NULL;
-+    }
-     if (SDL_VideoContext) {
-         /* SDL_GL_MakeCurrent(0, NULL); *//* Doesn't do anything */
-         SDL_GL_DeleteContext(SDL_VideoContext);
-@@ -348,6 +363,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
-     int window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(display);
-     int window_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(display);
-     Uint32 window_flags;
-+    Uint32 surface_flags;
- 
-     if (!initialized_video) {
-         if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) {
-@@ -407,6 +423,20 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
-     SDL_SetWindowIcon(SDL_VideoWindow, SDL_VideoIcon);
- 
-     window_flags = SDL_GetWindowFlags(SDL_VideoWindow);
-+    surface_flags = 0;
-+    if (window_flags & SDL_WINDOW_FULLSCREEN) {
-+        surface_flags |= SDL_FULLSCREEN;
-+    }
-+    if ((window_flags & SDL_WINDOW_OPENGL) && (flags & SDL_OPENGL)) {
-+        surface_flags |= SDL_OPENGL;
-+    }
-+    if (window_flags & SDL_WINDOW_RESIZABLE) {
-+        surface_flags |= SDL_RESIZABLE;
-+    }
-+    if (window_flags & SDL_WINDOW_BORDERLESS) {
-+        surface_flags |= SDL_NOFRAME;
-+    }
-+
-     SDL_VideoFlags = flags;
- 
-     /* If we're in OpenGL mode, just create a stub surface and we're done! */
-@@ -418,7 +448,13 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
-         if (SDL_GL_MakeCurrent(SDL_VideoWindow, SDL_VideoContext) < 0) {
-             return NULL;
-         }
--        SDL_PublicSurface = SDL_GetWindowSurface(SDL_VideoWindow);
-+        SDL_VideoSurface =
-+            SDL_CreateRGBSurfaceFrom(NULL, width, height, bpp, 0, 0, 0, 0, 0);
-+        if (!SDL_VideoSurface) {
-+            return NULL;
-+        }
-+        SDL_VideoSurface->flags |= surface_flags;
-+        SDL_PublicSurface = SDL_VideoSurface;
-         return SDL_PublicSurface;
-     }
- 
diff --git a/debian/patches/series b/debian/patches/series
index 27697ba..990490b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,4 +18,3 @@ countperop_rominfo.patch
 countperop_romdb.patch
 sdl2_no_surface.patch
 sdl2_destroywindow.patch
-sdl2_nogetsurface.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-core.git



More information about the Pkg-games-commits mailing list