Merge branch 'win32-gl-reorg-3' into 'gtk-3-24'
GDK-Win32: Reorganize backend GL code and add fallback mode See merge request GNOME/gtk!3859
This commit is contained in:
commit
ae8fde9630
@ -31,10 +31,6 @@
|
||||
#include "gdkmonitor-win32.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
# include <epoxy/egl.h>
|
||||
#endif
|
||||
|
||||
#include "gdkwin32langnotification.h"
|
||||
|
||||
#ifndef IMAGE_FILE_MACHINE_ARM64
|
||||
@ -1038,6 +1034,8 @@ _gdk_win32_enable_hidpi (GdkWin32Display *display)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* Keep code around in case we need to check for running on ARM64 in the future */
|
||||
static void
|
||||
_gdk_win32_check_on_arm64 (GdkWin32Display *display)
|
||||
{
|
||||
@ -1071,6 +1069,7 @@ _gdk_win32_check_on_arm64 (GdkWin32Display *display)
|
||||
g_once_init_leave (&checked, 1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
gdk_win32_display_init (GdkWin32Display *display)
|
||||
@ -1080,7 +1079,6 @@ gdk_win32_display_init (GdkWin32Display *display)
|
||||
display->monitors = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
|
||||
_gdk_win32_enable_hidpi (display);
|
||||
_gdk_win32_check_on_arm64 (display);
|
||||
|
||||
/* if we have DPI awareness, set up fixed scale if set */
|
||||
if (display->dpi_aware_type != PROCESS_DPI_UNAWARE &&
|
||||
@ -1299,7 +1297,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
|
||||
display_class->convert_selection = _gdk_win32_display_convert_selection;
|
||||
display_class->text_property_to_utf8_list = _gdk_win32_display_text_property_to_utf8_list;
|
||||
display_class->utf8_to_string_target = _gdk_win32_display_utf8_to_string_target;
|
||||
display_class->make_gl_context_current = _gdk_win32_display_make_gl_context_current;
|
||||
display_class->make_gl_context_current = gdk_win32_display_make_gl_context_current;
|
||||
|
||||
display_class->get_n_monitors = gdk_win32_display_get_n_monitors;
|
||||
display_class->get_monitor = gdk_win32_display_get_monitor;
|
||||
|
@ -18,10 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "gdkdisplayprivate.h"
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
# include <epoxy/egl.h>
|
||||
#endif
|
||||
#include "gdkglcontext-win32.h"
|
||||
|
||||
#ifndef __GDK_DISPLAY__WIN32_H__
|
||||
#define __GDK_DISPLAY__WIN32_H__
|
||||
@ -33,6 +30,15 @@ typedef enum _GdkWin32ProcessDpiAwareness {
|
||||
PROCESS_PER_MONITOR_DPI_AWARE = 2
|
||||
} GdkWin32ProcessDpiAwareness;
|
||||
|
||||
/* Define values for GL type used */
|
||||
typedef enum _GdkWin32GLContextType
|
||||
{
|
||||
GDK_WIN32_GL_PENDING,
|
||||
GDK_WIN32_GL_NONE,
|
||||
GDK_WIN32_GL_WGL,
|
||||
GDK_WIN32_GL_EGL
|
||||
} GdkWin32GLContextType;
|
||||
|
||||
/* APIs from shcore.dll */
|
||||
typedef HRESULT (WINAPI *funcSetProcessDpiAwareness) (GdkWin32ProcessDpiAwareness value);
|
||||
typedef HRESULT (WINAPI *funcGetProcessDpiAwareness) (HANDLE handle,
|
||||
@ -81,20 +87,11 @@ struct _GdkWin32Display
|
||||
HWND hwnd;
|
||||
HWND clipboard_hwnd;
|
||||
|
||||
/* WGL/OpenGL Items */
|
||||
guint have_wgl : 1;
|
||||
/* OpenGL Items */
|
||||
GdkWin32GLContextType gl_type;
|
||||
guint gl_version;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
/* EGL (Angle) Items */
|
||||
guint have_egl : 1;
|
||||
guint egl_version;
|
||||
EGLDisplay egl_disp;
|
||||
HDC hdc_egl_temp;
|
||||
#endif
|
||||
|
||||
GPtrArray *monitors;
|
||||
|
||||
/* WGL Items */
|
||||
guint hasWglARBCreateContext : 1;
|
||||
guint hasWglEXTSwapControl : 1;
|
||||
guint hasWglOMLSyncControl : 1;
|
||||
@ -104,12 +101,19 @@ struct _GdkWin32Display
|
||||
/* compensate around Intel OpenGL driver issues on blitting, see issue #3487 */
|
||||
guint needIntelGLWorkaround : 1;
|
||||
|
||||
/* EGL (Angle) Items */
|
||||
HDC hdc_egl_temp;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLDisplay egl_disp;
|
||||
EGLConfig egl_config;
|
||||
guint hasEglKHRCreateContext : 1;
|
||||
guint hasEglSurfacelessContext : 1;
|
||||
EGLint egl_min_swap_interval;
|
||||
#endif
|
||||
|
||||
GPtrArray *monitors;
|
||||
|
||||
/* HiDPI Items */
|
||||
guint have_at_least_win81 : 1;
|
||||
GdkWin32ProcessDpiAwareness dpi_aware_type;
|
||||
@ -120,7 +124,6 @@ struct _GdkWin32Display
|
||||
GdkWin32User32DPIFuncs user32_dpi_funcs;
|
||||
|
||||
/* Running CPU items */
|
||||
guint running_on_arm64 : 1;
|
||||
GdkWin32KernelCPUFuncs cpu_funcs;
|
||||
};
|
||||
|
||||
|
@ -3348,7 +3348,7 @@ gdk_event_translate (MSG *msg,
|
||||
do_show_window (window, msg->wParam == SC_MINIMIZE ? TRUE : FALSE);
|
||||
|
||||
if (msg->wParam == SC_RESTORE)
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
break;
|
||||
case SC_MAXIMIZE:
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
@ -3436,7 +3436,7 @@ gdk_event_translate (MSG *msg,
|
||||
{
|
||||
MINMAXINFO our_mmi;
|
||||
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
|
||||
if (_gdk_win32_window_fill_min_max_info (window, &our_mmi))
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -32,62 +32,25 @@
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkvisual.h"
|
||||
#include "gdkwindow.h"
|
||||
#include "gdkinternals.h"
|
||||
#include "gdkmain.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
struct _GdkWin32GLContext
|
||||
{
|
||||
GdkGLContext parent_instance;
|
||||
|
||||
/* WGL Context Items */
|
||||
HGLRC hglrc;
|
||||
HDC gl_hdc;
|
||||
guint need_alpha_bits : 1;
|
||||
|
||||
/* other items */
|
||||
guint is_attached : 1;
|
||||
guint do_frame_sync : 1;
|
||||
guint do_blit_swap : 1;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
/* EGL (Angle) Context Items */
|
||||
EGLContext egl_context;
|
||||
EGLConfig egl_config;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct _GdkWin32GLContextClass
|
||||
{
|
||||
GdkGLContextClass parent_class;
|
||||
};
|
||||
void
|
||||
gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
|
||||
|
||||
GdkGLContext *
|
||||
_gdk_win32_window_create_gl_context (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
gdk_win32_window_create_gl_context (GdkWindow *window,
|
||||
gboolean attached,
|
||||
GdkGLContext *share,
|
||||
GError **error);
|
||||
|
||||
void
|
||||
_gdk_win32_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
cairo_region_t *update_area);
|
||||
|
||||
void
|
||||
_gdk_win32_gl_context_end_frame (GdkGLContext *context,
|
||||
cairo_region_t *painted,
|
||||
cairo_region_t *damage);
|
||||
gdk_win32_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
cairo_region_t *update_area);
|
||||
|
||||
gboolean
|
||||
_gdk_win32_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context);
|
||||
|
||||
gboolean
|
||||
_gdk_win32_gl_context_realize (GdkGLContext *context,
|
||||
GError **error);
|
||||
|
||||
void
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (GdkWindow *window);
|
||||
gdk_win32_display_make_gl_context_current (GdkDisplay *display,
|
||||
GdkGLContext *context);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -1690,7 +1690,7 @@ gdk_win32_window_move_resize (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
if (with_move)
|
||||
{
|
||||
gdk_win32_window_move_resize_internal (window, x, y, width, height);
|
||||
@ -4758,7 +4758,7 @@ gdk_win32_window_end_move_resize_drag (GdkWindow *window)
|
||||
GdkW32DragMoveResizeContext *context = &impl->drag_move_resize_context;
|
||||
|
||||
if (context->op == GDK_WIN32_DRAGOP_RESIZE)
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
|
||||
context->op = GDK_WIN32_DRAGOP_NONE;
|
||||
|
||||
@ -5279,7 +5279,7 @@ gdk_win32_window_unmaximize (GdkWindow *window)
|
||||
GDK_WINDOW_HWND (window),
|
||||
_gdk_win32_window_state_to_string (window->state)));
|
||||
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
GtkShowWindow (window, SW_RESTORE);
|
||||
@ -5376,7 +5376,7 @@ gdk_win32_window_unfullscreen (GdkWindow *window)
|
||||
|
||||
impl->hint_flags = fi->hint_flags;
|
||||
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, fi->style);
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST,
|
||||
fi->r.left, fi->r.top,
|
||||
fi->r.right - fi->r.left, fi->r.bottom - fi->r.top,
|
||||
@ -6279,8 +6279,8 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
|
||||
impl_class->get_property = _gdk_win32_window_get_property;
|
||||
impl_class->change_property = _gdk_win32_window_change_property;
|
||||
impl_class->delete_property = _gdk_win32_window_delete_property;
|
||||
impl_class->create_gl_context = _gdk_win32_window_create_gl_context;
|
||||
impl_class->invalidate_for_new_frame = _gdk_win32_window_invalidate_for_new_frame;
|
||||
impl_class->create_gl_context = gdk_win32_window_create_gl_context;
|
||||
impl_class->invalidate_for_new_frame = gdk_win32_window_invalidate_for_new_frame;
|
||||
impl_class->get_scale_factor = _gdk_win32_window_get_scale_factor;
|
||||
impl_class->get_unscaled_size = _gdk_win32_window_get_unscaled_size;
|
||||
}
|
||||
|
@ -26,15 +26,12 @@
|
||||
#define __GDK_WINDOW_WIN32_H__
|
||||
|
||||
#include "gdk/win32/gdkprivate-win32.h"
|
||||
#include "gdk/win32/gdkglcontext-win32.h"
|
||||
#include "gdk/gdkwindowimpl.h"
|
||||
#include "gdk/gdkcursor.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
#include <epoxy/egl.h>
|
||||
#endif
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Window implementation for Win32
|
||||
|
Loading…
Reference in New Issue
Block a user