diff options
author | Benjamin Otte <otte@redhat.com> | 2016-10-27 23:27:49 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-10-28 05:22:49 +0200 |
commit | f420dc74566ef1c284cd22314017e12624d51a15 (patch) | |
tree | 106d8b2ae93b77b541c6e7431fc81671c6a77ff9 /gdk/win32 | |
parent | 6cc94ff1763635d68c0eb2bf7c5f52ed0142b554 (diff) | |
download | gtk+-f420dc74566ef1c284cd22314017e12624d51a15.tar.gz |
API: gdk: Remove gdk_window_get_visual()
With it, remove window->visual.
Diffstat (limited to 'gdk/win32')
-rw-r--r-- | gdk/win32/gdkglcontext-win32.c | 29 | ||||
-rw-r--r-- | gdk/win32/gdkmain-win32.c | 5 | ||||
-rw-r--r-- | gdk/win32/gdkwindow-win32.c | 3 |
3 files changed, 9 insertions, 28 deletions
diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c index 520d253fd2..499f8313e4 100644 --- a/gdk/win32/gdkglcontext-win32.c +++ b/gdk/win32/gdkglcontext-win32.c @@ -278,7 +278,6 @@ _get_dummy_window_hwnd (GdkWGLDummy *dummy) static gint _get_wgl_pfd (HDC hdc, - const gboolean need_alpha_bits, PIXELFORMATDESCRIPTOR *pfd) { gint best_pf = 0; @@ -293,16 +292,6 @@ _get_wgl_pfd (HDC hdc, best_pf = ChoosePixelFormat (hdc, pfd); - if (best_pf == 0) - /* give another chance if need_alpha_bits is FALSE, - * meaning we prefer to have an alpha channel anyways - */ - if (!need_alpha_bits) - { - pfd->cAlphaBits = 0; - best_pf = ChoosePixelFormat (hdc, pfd); - } - return best_pf; } @@ -310,8 +299,7 @@ _get_wgl_pfd (HDC hdc, * one and cache it for later use */ static gint -_gdk_init_dummy_context (GdkWGLDummy *dummy, - const gboolean need_alpha_bits) +_gdk_init_dummy_context (GdkWGLDummy *dummy) { PIXELFORMATDESCRIPTOR pfd; gboolean set_pixel_format_result = FALSE; @@ -322,7 +310,7 @@ _gdk_init_dummy_context (GdkWGLDummy *dummy, dummy->hdc = GetDC (dummy->hwnd); memset (&pfd, 0, sizeof (PIXELFORMATDESCRIPTOR)); - best_idx = _get_wgl_pfd (dummy->hdc, need_alpha_bits, &pfd); + best_idx = _get_wgl_pfd (dummy->hdc, &pfd); if (best_idx != 0) set_pixel_format_result = SetPixelFormat (dummy->hdc, @@ -342,8 +330,7 @@ _gdk_init_dummy_context (GdkWGLDummy *dummy, } gboolean -_gdk_win32_display_init_gl (GdkDisplay *display, - const gboolean need_alpha_bits) +_gdk_win32_display_init_gl (GdkDisplay *display) { GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display); gint best_idx = 0; @@ -358,7 +345,7 @@ _gdk_win32_display_init_gl (GdkDisplay *display, * dummy GL Context, it is used to query functions * and used for other stuff as well */ - best_idx = _gdk_init_dummy_context (&dummy, need_alpha_bits); + best_idx = _gdk_init_dummy_context (&dummy); if (best_idx == 0 || !wglMakeCurrent (dummy.hdc, dummy.hglrc)) return FALSE; @@ -541,15 +528,12 @@ _gdk_win32_window_create_gl_context (GdkWindow *window, GdkDisplay *display = gdk_window_get_display (window); GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_window_get_display (window)); GdkWin32GLContext *context = NULL; - GdkVisual *visual = gdk_window_get_visual (window); - - gboolean need_alpha_bits = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display))); /* Acquire and store up the Windows-specific HWND and HDC */ HWND hwnd; HDC hdc; - if (!_gdk_win32_display_init_gl (display, need_alpha_bits)) + if (!_gdk_win32_display_init_gl (display)) { g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE, @@ -580,7 +564,6 @@ _gdk_win32_window_create_gl_context (GdkWindow *window, "shared-context", share, NULL); - context->need_alpha_bits = need_alpha_bits; context->gl_hdc = hdc; context->is_attached = attached; @@ -662,7 +645,7 @@ gdk_win32_display_get_wgl_version (GdkDisplay *display, if (!GDK_IS_WIN32_DISPLAY (display)) return FALSE; - if (!_gdk_win32_display_init_gl (display, FALSE)) + if (!_gdk_win32_display_init_gl (display)) return FALSE; if (major != NULL) diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c index de2d1f8970..5d17072834 100644 --- a/gdk/win32/gdkmain-win32.c +++ b/gdk/win32/gdkmain-win32.c @@ -964,12 +964,11 @@ _gdk_win32_window_description (GdkWindow *d) { g_return_val_if_fail (GDK_IS_WINDOW (d), NULL); - return static_printf ("%s:%p:%dx%dx%d", + return static_printf ("%s:%p:%dx%d", G_OBJECT_TYPE_NAME (d), GDK_WINDOW_HWND (d), gdk_window_get_width (GDK_WINDOW (d)), - gdk_window_get_height (GDK_WINDOW (d)), - gdk_visual_get_depth (gdk_window_get_visual (GDK_WINDOW (d)))); + gdk_window_get_height (GDK_WINDOW (d))); } #endif /* G_ENABLE_DEBUG */ diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c index 12d57c16ea..c0ba2bcd59 100644 --- a/gdk/win32/gdkwindow-win32.c +++ b/gdk/win32/gdkwindow-win32.c @@ -2262,10 +2262,9 @@ gdk_win32_window_get_geometry (GdkWindow *window, if (height) *height = rect.bottom - rect.top; - GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ldx%d@%+ld%+ld\n", + GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ld@%+ld%+ld\n", GDK_WINDOW_HWND (window), rect.right - rect.left, rect.bottom - rect.top, - gdk_window_get_visual (window)->depth, rect.left, rect.top)); } } |