[gtk+] gdk: Make GdkDrawingContext not per-backend
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk: Make GdkDrawingContext not per-backend
- Date: Wed, 30 Nov 2016 15:07:49 +0000 (UTC)
commit efd04b47aa9089d9d276528423786b0e0d605c5f
Author: Benjamin Otte <otte redhat com>
Date: Wed Nov 30 15:52:22 2016 +0100
gdk: Make GdkDrawingContext not per-backend
No backend is using it, and we can put the backend-specific drawing code
into GdkGLContext.
gdk/broadway/Makefile.am | 2 -
gdk/broadway/gdkdrawingcontext-broadway.c | 33 ---------------
gdk/broadway/gdkdrawingcontext-broadway.h | 48 ---------------------
gdk/broadway/gdkwindow-broadway.c | 12 -----
gdk/gdkwindow.c | 5 ++-
gdk/gdkwindowimpl.h | 3 -
gdk/mir/Makefile.am | 1 -
gdk/mir/gdkmir-private.h | 2 -
gdk/mir/gdkmirdrawingcontext.c | 64 -----------------------------
gdk/mir/gdkmirwindowimpl.c | 1 -
gdk/quartz/Makefile.am | 2 -
gdk/quartz/gdkdrawingcontext-quartz.c | 33 ---------------
gdk/quartz/gdkdrawingcontext-quartz.h | 48 ---------------------
gdk/quartz/gdkwindow-quartz.c | 12 -----
gdk/wayland/Makefile.am | 2 -
gdk/wayland/gdkdrawingcontext-wayland.c | 33 ---------------
gdk/wayland/gdkdrawingcontext-wayland.h | 48 ---------------------
gdk/wayland/gdkwindow-wayland.c | 12 -----
gdk/win32/Makefile.am | 2 -
gdk/win32/gdkdrawingcontext-win32.c | 33 ---------------
gdk/win32/gdkdrawingcontext-win32.h | 48 ---------------------
gdk/win32/gdkwindow-win32.c | 12 -----
gdk/x11/Makefile.am | 2 -
gdk/x11/gdkdrawingcontext-x11.c | 33 ---------------
gdk/x11/gdkdrawingcontext-x11.h | 48 ---------------------
gdk/x11/gdkwindow-x11.c | 12 -----
26 files changed, 4 insertions(+), 547 deletions(-)
---
diff --git a/gdk/broadway/Makefile.am b/gdk/broadway/Makefile.am
index fad502a..59c181e 100644
--- a/gdk/broadway/Makefile.am
+++ b/gdk/broadway/Makefile.am
@@ -61,8 +61,6 @@ libgdk_broadway_la_SOURCES = \
gdkdisplay-broadway.c \
gdkdisplay-broadway.h \
gdkdnd-broadway.c \
- gdkdrawingcontext-broadway.c \
- gdkdrawingcontext-broadway.h \
gdkeventsource.c \
gdkeventsource.h \
gdkglobals-broadway.c \
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 1271616..5004d4c 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -33,7 +33,6 @@
#include "gdkwindow.h"
#include "gdkwindowimpl.h"
#include "gdkdisplay-broadway.h"
-#include "gdkdrawingcontext-broadway.h"
#include "gdkprivate-broadway.h"
#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
@@ -1501,16 +1500,6 @@ gdk_broadway_get_last_seen_time (GdkWindow *window)
return _gdk_broadway_server_get_last_seen_time (GDK_BROADWAY_DISPLAY (display)->server);
}
-static GdkDrawingContext *
-gdk_broadway_window_create_draw_context (GdkWindow *window,
- const cairo_region_t *region)
-{
- return g_object_new (GDK_TYPE_BROADWAY_DRAWING_CONTEXT,
- "window", window,
- "clip", region,
- NULL);
-}
-
static void
gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
{
@@ -1589,5 +1578,4 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->change_property = _gdk_broadway_window_change_property;
impl_class->delete_property = _gdk_broadway_window_delete_property;
impl_class->get_drag_protocol = _gdk_broadway_window_get_drag_protocol;
- impl_class->create_draw_context = gdk_broadway_window_create_draw_context;
}
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 2ff89ee..9ddec1b 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2911,7 +2911,10 @@ gdk_window_begin_draw_frame (GdkWindow *window,
gdk_window_begin_paint_internal (window, region);
- context = GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_draw_context (window, region);
+ context = g_object_new (GDK_TYPE_DRAWING_CONTEXT,
+ "window", window,
+ "clip", region,
+ NULL);
/* Do not take a reference, to avoid creating cycles */
window->drawing_context = context;
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index d15b9da..82f7de9 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -301,9 +301,6 @@ struct _GdkWindowImplClass
GError **error);
void (*invalidate_for_new_frame)(GdkWindow *window,
cairo_region_t *update_area);
-
- GdkDrawingContext *(* create_draw_context) (GdkWindow *window,
- const cairo_region_t *region);
};
/* Interface Functions */
diff --git a/gdk/mir/Makefile.am b/gdk/mir/Makefile.am
index 87ec55b..654b8f9 100644
--- a/gdk/mir/Makefile.am
+++ b/gdk/mir/Makefile.am
@@ -24,7 +24,6 @@ libgdk_mir_la_SOURCES = \
gdkmircursor.c \
gdkmirdevicemanager.c \
gdkmirdisplay.c \
- gdkmirdrawingcontext.c \
gdkmireventsource.c \
gdkmirglcontext.c \
gdkmirkeyboard.c \
diff --git a/gdk/mir/gdkmir-private.h b/gdk/mir/gdkmir-private.h
index afe7a7c..69f927f 100644
--- a/gdk/mir/gdkmir-private.h
+++ b/gdk/mir/gdkmir-private.h
@@ -95,8 +95,6 @@ void _gdk_mir_window_impl_set_cursor_state (GdkMirWindowImpl *impl, gdouble x, g
void _gdk_mir_window_impl_get_cursor_state (GdkMirWindowImpl *impl, gdouble *x, gdouble *y, gboolean
*cursor_inside, guint *button_state);
-GdkDrawingContext *gdk_mir_drawing_context_new (GdkWindow *window, const cairo_region_t *region);
-
GdkMirEventSource *_gdk_mir_display_get_event_source (GdkDisplay *display);
GdkMirEventSource *_gdk_mir_event_source_new (GdkDisplay *display);
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index 5e0e1fc..7fc9376 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -1830,6 +1830,5 @@ gdk_mir_window_impl_class_init (GdkMirWindowImplClass *klass)
impl_class->set_opaque_region = gdk_mir_window_impl_set_opaque_region;
impl_class->set_shadow_width = gdk_mir_window_impl_set_shadow_width;
impl_class->create_gl_context = gdk_mir_window_impl_create_gl_context;
- impl_class->create_draw_context = gdk_mir_drawing_context_new;
impl_class->invalidate_for_new_frame = gdk_mir_window_impl_invalidate_for_new_frame;
}
diff --git a/gdk/quartz/Makefile.am b/gdk/quartz/Makefile.am
index ba5e8d2..eda5263 100644
--- a/gdk/quartz/Makefile.am
+++ b/gdk/quartz/Makefile.am
@@ -30,8 +30,6 @@ libgdk_quartz_la_SOURCES = \
gdkdevicemanager-core-quartz.h \
gdkdisplay-quartz.c \
gdkdisplaymanager-quartz.c \
- gdkdrawingcontext-quartz.c \
- gdkdrawingcontext-quartz.h \
gdkdnd-quartz.c \
gdkdnd-quartz.h \
gdkevents-quartz.c \
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index ae2ca22..3f68c68 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -25,7 +25,6 @@
#include "gdkwindowimpl.h"
#include "gdkprivate-quartz.h"
-#include "gdkdrawingcontext-quartz.h"
#include "gdkglcontext-quartz.h"
#include "gdkquartzscreen.h"
#include "gdkquartzcursor.h"
@@ -2788,16 +2787,6 @@ gdk_quartz_window_get_scale_factor (GdkWindow *window)
return 1;
}
-static GdkDrawingContext *
-gdk_quartz_window_create_draw_context (GdkWindow *window,
- const cairo_region_t *region)
-{
- return g_object_new (GDK_TYPE_QUARTZ_DRAWING_CONTEXT,
- "window", window,
- "clip", region,
- NULL);
-}
-
static void
gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
{
@@ -2882,7 +2871,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->delete_property = _gdk_quartz_window_delete_property;
impl_class->create_gl_context = gdk_quartz_window_create_gl_context;
- impl_class->create_draw_context = gdk_quartz_window_create_draw_context;
impl_quartz_class->get_context = gdk_window_impl_quartz_get_context;
impl_quartz_class->release_context = gdk_window_impl_quartz_release_context;
diff --git a/gdk/wayland/Makefile.am b/gdk/wayland/Makefile.am
index c40e24f..127e091 100644
--- a/gdk/wayland/Makefile.am
+++ b/gdk/wayland/Makefile.am
@@ -46,8 +46,6 @@ libgdk_wayland_la_SOURCES = \
gdkdevice-wayland.c \
gdkdisplay-wayland.c \
gdkdisplay-wayland.h \
- gdkdrawingcontext-wayland.c \
- gdkdrawingcontext-wayland.h \
gdkdnd-wayland.c \
gdkeventsource.c \
gdkkeys-wayland.c \
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 5360c4b..e8db78b 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -26,7 +26,6 @@
#include "gdkwindow.h"
#include "gdkwindowimpl.h"
#include "gdkdisplay-wayland.h"
-#include "gdkdrawingcontext-wayland.h"
#include "gdkglcontext-wayland.h"
#include "gdkframeclockprivate.h"
#include "gdkprivate-wayland.h"
@@ -3568,16 +3567,6 @@ gdk_wayland_window_show_window_menu (GdkWindow *window,
return TRUE;
}
-static GdkDrawingContext *
-gdk_wayland_window_create_draw_context (GdkWindow *window,
- const cairo_region_t *region)
-{
- return g_object_new (GDK_TYPE_WAYLAND_DRAWING_CONTEXT,
- "window", window,
- "clip", region,
- NULL);
-}
-
static void
_gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
{
@@ -3665,7 +3654,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
impl_class->set_shadow_width = gdk_wayland_window_set_shadow_width;
impl_class->show_window_menu = gdk_wayland_window_show_window_menu;
impl_class->create_gl_context = gdk_wayland_window_create_gl_context;
- impl_class->create_draw_context = gdk_wayland_window_create_draw_context;
impl_class->invalidate_for_new_frame = gdk_wayland_window_invalidate_for_new_frame;
signals[COMMITTED] = g_signal_new ("committed",
diff --git a/gdk/win32/Makefile.am b/gdk/win32/Makefile.am
index eb76bbc..ebd4ae6 100644
--- a/gdk/win32/Makefile.am
+++ b/gdk/win32/Makefile.am
@@ -40,8 +40,6 @@ libgdk_win32_la_SOURCES = \
gdkdisplay-win32.c \
gdkdisplay-win32.h \
gdkdisplaymanager-win32.c \
- gdkdrawingcontext-win32.c \
- gdkdrawingcontext-win32.h \
gdkdnd-win32.c \
gdkevents-win32.c \
gdkgeometry-win32.c \
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index f5c4be4..cddd9ef 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -41,7 +41,6 @@
#include "gdkwin32window.h"
#include "gdkglcontext-win32.h"
#include "gdkdisplay-win32.h"
-#include "gdkdrawingcontext-win32.h"
#include <cairo-win32.h>
#include <dwmapi.h>
@@ -6026,16 +6025,6 @@ _gdk_win32_window_get_unscaled_size (GdkWindow *window,
*unscaled_height = impl->unscaled_height;
}
-static GdkDrawingContext *
-gdk_win32_window_create_draw_context (GdkWindow *window,
- const cairo_region_t *region)
-{
- return g_object_new (GDK_TYPE_WIN32_DRAWING_CONTEXT,
- "window", window,
- "clip", region,
- NULL);
-}
-
static void
gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
{
@@ -6125,7 +6114,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
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->create_draw_context = gdk_win32_window_create_draw_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;
diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am
index cd4d0e0..c233520 100644
--- a/gdk/x11/Makefile.am
+++ b/gdk/x11/Makefile.am
@@ -35,8 +35,6 @@ libgdk_x11_la_SOURCES = \
gdkdisplay-x11.c \
gdkdisplay-x11.h \
gdkdnd-x11.c \
- gdkdrawingcontext-x11.c \
- gdkdrawingcontext-x11.h \
gdkeventsource.c \
gdkeventsource.h \
gdkeventtranslator.c \
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 204e562..09de9b2 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -36,7 +36,6 @@
#include "gdkasync.h"
#include "gdkeventsource.h"
#include "gdkdisplay-x11.h"
-#include "gdkdrawingcontext-x11.h"
#include "gdkglcontext-x11.h"
#include "gdkprivate-x11.h"
#include "gdk-private.h"
@@ -211,16 +210,6 @@ gdk_x11_window_get_unscaled_size (GdkWindow *window,
*unscaled_height = impl->unscaled_height;
}
-static GdkDrawingContext *
-gdk_x11_window_create_draw_context (GdkWindow *window,
- const cairo_region_t *region)
-{
- return g_object_new (GDK_TYPE_X11_DRAWING_CONTEXT,
- "window", window,
- "clip", region,
- NULL);
-}
-
static void
set_sync_counter(Display *display,
XSyncCounter counter,
@@ -5405,6 +5394,5 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
impl_class->show_window_menu = gdk_x11_window_show_window_menu;
impl_class->create_gl_context = gdk_x11_window_create_gl_context;
impl_class->invalidate_for_new_frame = gdk_x11_window_invalidate_for_new_frame;
- impl_class->create_draw_context = gdk_x11_window_create_draw_context;
impl_class->get_unscaled_size = gdk_x11_window_get_unscaled_size;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]