[gtk/wip.win32.fixes: 10/11] GdkWin32: Clean up gdk_win32_surface_handle_queued_move_resize()




commit 9ded3a9e4e408346d55209274c89df2196b0fde6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon May 9 12:43:09 2022 +0800

    GdkWin32: Clean up gdk_win32_surface_handle_queued_move_resize()
    
    Make that function accept a GdkSurface, not a GdkDrawContext, to make things
    clearer to people.

 gdk/win32/gdkcairocontext-win32.c  | 2 +-
 gdk/win32/gdkglcontext-win32-egl.c | 4 +++-
 gdk/win32/gdkglcontext-win32-wgl.c | 4 +++-
 gdk/win32/gdksurface-win32.c       | 4 +---
 gdk/win32/gdksurface-win32.h       | 2 +-
 gdk/win32/gdkvulkancontext-win32.c | 4 +++-
 6 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/gdk/win32/gdkcairocontext-win32.c b/gdk/win32/gdkcairocontext-win32.c
index 480baf7802..0a87c4031e 100644
--- a/gdk/win32/gdkcairocontext-win32.c
+++ b/gdk/win32/gdkcairocontext-win32.c
@@ -66,7 +66,7 @@ gdk_win32_cairo_context_begin_frame (GdkDrawContext *draw_context,
   surface = gdk_draw_context_get_surface (draw_context);
   scale = gdk_surface_get_scale_factor (surface);
 
-  queued_window_rect = gdk_win32_surface_handle_queued_move_resize (draw_context);
+  queued_window_rect = gdk_win32_surface_handle_queued_move_resize (surface);
 
   width = queued_window_rect.right - queued_window_rect.left;
   height = queued_window_rect.bottom - queued_window_rect.top;
diff --git a/gdk/win32/gdkglcontext-win32-egl.c b/gdk/win32/gdkglcontext-win32-egl.c
index 761eae1802..625d338a3f 100644
--- a/gdk/win32/gdkglcontext-win32-egl.c
+++ b/gdk/win32/gdkglcontext-win32-egl.c
@@ -119,7 +119,9 @@ gdk_win32_gl_context_egl_begin_frame (GdkDrawContext *draw_context,
                                       gboolean        prefers_high_depth,
                                       cairo_region_t *update_area)
 {
-  gdk_win32_surface_handle_queued_move_resize (draw_context);
+  GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
+
+  gdk_win32_surface_handle_queued_move_resize (surface);
 
   GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->begin_frame (draw_context, 
prefers_high_depth, update_area);
 }
diff --git a/gdk/win32/gdkglcontext-win32-wgl.c b/gdk/win32/gdkglcontext-win32-wgl.c
index d7ff4367f2..c94d2bed76 100644
--- a/gdk/win32/gdkglcontext-win32-wgl.c
+++ b/gdk/win32/gdkglcontext-win32-wgl.c
@@ -121,7 +121,9 @@ gdk_win32_gl_context_wgl_begin_frame (GdkDrawContext *draw_context,
                                       gboolean        prefers_high_depth,
                                       cairo_region_t *update_area)
 {
-  gdk_win32_surface_handle_queued_move_resize (draw_context);
+  GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
+
+  gdk_win32_surface_handle_queued_move_resize (surface);
 
   GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_wgl_parent_class)->begin_frame (draw_context, 
prefers_high_depth, update_area);
 }
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index 81e7308e2a..36308d4048 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -5078,14 +5078,12 @@ gdk_win32_surface_apply_queued_move_resize (GdkSurface *surface,
 }
 
 RECT
-gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context)
+gdk_win32_surface_handle_queued_move_resize (GdkSurface *surface)
 {
-  GdkSurface *surface;
   GdkWin32Surface *impl;
   int scale;
   RECT queued_window_rect;
 
-  surface = gdk_draw_context_get_surface (draw_context);
   impl = GDK_WIN32_SURFACE (surface);
   scale = gdk_surface_get_scale_factor (surface);
 
diff --git a/gdk/win32/gdksurface-win32.h b/gdk/win32/gdksurface-win32.h
index cff41117ef..756b06eb1a 100644
--- a/gdk/win32/gdksurface-win32.h
+++ b/gdk/win32/gdksurface-win32.h
@@ -374,7 +374,7 @@ void gdk_win32_surface_move_resize (GdkSurface *window,
                                     int         height);
 
 RECT
-gdk_win32_surface_handle_queued_move_resize (GdkDrawContext *draw_context);
+gdk_win32_surface_handle_queued_move_resize  (GdkSurface *surface);
 
 #ifdef HAVE_EGL
 EGLSurface gdk_win32_surface_get_egl_surface (GdkSurface *surface,
diff --git a/gdk/win32/gdkvulkancontext-win32.c b/gdk/win32/gdkvulkancontext-win32.c
index 894bbfa548..88a37f6985 100644
--- a/gdk/win32/gdkvulkancontext-win32.c
+++ b/gdk/win32/gdkvulkancontext-win32.c
@@ -71,7 +71,9 @@ gdk_win32_vulkan_context_begin_frame (GdkDrawContext *draw_context,
                                       gboolean        prefers_high_depth,
                                       cairo_region_t *update_area)
 {
-  gdk_win32_surface_handle_queued_move_resize (draw_context);
+  GdkSurface *surface = gdk_draw_context_get_surface (draw_context);
+
+  gdk_win32_surface_handle_queued_move_resize (surface);
 
   GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, 
prefers_high_depth, update_area);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]