[gtk/master.win32: 13/16] gdkvulkancontext-win32.c: Implement ->begin_frame()




commit acf27fece8679e67ca8f3efb3ab0d6f079b1a91e
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Aug 3 18:43:46 2020 +0800

    gdkvulkancontext-win32.c: Implement ->begin_frame()
    
    By doing so, we ensure that resizes of windows will work on Vulkan renderer, by
    first calling gdk_win32_surface_handle_queued_move_resize() before we proceed
    as usual

 gdk/win32/gdkvulkancontext-win32.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/gdk/win32/gdkvulkancontext-win32.c b/gdk/win32/gdkvulkancontext-win32.c
index 607658dde9..e0d9ae8473 100644
--- a/gdk/win32/gdkvulkancontext-win32.c
+++ b/gdk/win32/gdkvulkancontext-win32.c
@@ -72,12 +72,23 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
   return result;
 }
 
+static void
+gdk_win32_vulkan_context_begin_frame (GdkDrawContext *draw_context,
+                                      cairo_region_t *update_area)
+{
+  gdk_win32_surface_handle_queued_move_resize (draw_context);
+
+  GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, update_area);
+}
+
 static void
 gdk_win32_vulkan_context_class_init (GdkWin32VulkanContextClass *klass)
 {
   GdkVulkanContextClass *context_class = GDK_VULKAN_CONTEXT_CLASS (klass);
+  GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS (klass);
 
   context_class->create_surface = gdk_win32_vulkan_context_create_surface;
+  draw_context_class->begin_frame = gdk_win32_vulkan_context_begin_frame;
 }
 
 static void


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