surface: Remove unused gdk_surface_get_unscaled_size()

Also remove unscaled_width/height members in the win32 backend.

Both of those are unused.
This commit is contained in:
Benjamin Otte 2021-03-15 02:56:28 +01:00
parent 1fd534ef1e
commit 97fad45237
5 changed files with 4 additions and 80 deletions

View File

@ -2610,37 +2610,6 @@ gdk_surface_get_scale_factor (GdkSurface *surface)
return 1;
}
/* Returns the *real* unscaled size, which may be a fractional size
in surface scale coordinates. We need this to properly handle GL
coordinates which are y-flipped in the real coordinates. */
void
gdk_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height)
{
GdkSurfaceClass *class;
int scale;
g_return_if_fail (GDK_IS_SURFACE (surface));
class = GDK_SURFACE_GET_CLASS (surface);
if (class->get_unscaled_size)
{
class->get_unscaled_size (surface, unscaled_width, unscaled_height);
return;
}
scale = gdk_surface_get_scale_factor (surface);
if (unscaled_width)
*unscaled_width = surface->width * scale;
if (unscaled_height)
*unscaled_height = surface->height * scale;
}
/**
* gdk_surface_set_opaque_region:
* @surface: a top-level `GdkSurface`

View File

@ -157,9 +157,6 @@ struct _GdkSurfaceClass
double dy);
int (* get_scale_factor) (GdkSurface *surface);
void (* get_unscaled_size) (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height);
void (* set_opaque_region) (GdkSurface *surface,
cairo_region_t *region);
@ -271,9 +268,6 @@ GdkGLContext * gdk_surface_get_paint_gl_context (GdkSurface *surface,
GError **error);
GdkGLContext * gdk_surface_get_shared_data_gl_context (GdkSurface *surface);
void gdk_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height);
gboolean gdk_surface_handle_event (GdkEvent *event);
GdkSeat * gdk_surface_get_seat_from_event (GdkSurface *surface,
GdkEvent *event);

View File

@ -520,8 +520,6 @@ _gdk_win32_display_create_surface (GdkDisplay *display,
surface->height = height;
impl->surface_scale = _gdk_win32_display_get_monitor_scale_factor (display_win32, NULL, NULL, NULL);
impl->unscaled_width = width * impl->surface_scale;
impl->unscaled_height = height * impl->surface_scale;
dwExStyle = 0;
owner = NULL;
@ -3969,12 +3967,9 @@ gdk_win32_surface_do_move_resize_drag (GdkSurface *window,
{
int scale = impl->surface_scale;
impl->unscaled_width = new_rect.right - new_rect.left;
impl->unscaled_height = new_rect.bottom - new_rect.top;
impl->next_layout.configured_rect = new_rect;
impl->next_layout.configured_width = (impl->unscaled_width + scale - 1) / scale;
impl->next_layout.configured_height = (impl->unscaled_height + scale - 1) / scale;
impl->next_layout.configured_width = (new_rect.right - new_rect.left + scale - 1) / scale;
impl->next_layout.configured_height = (new_rect.bottom - new_rect.top + scale - 1) / scale;
}
context->native_move_resize_pending = TRUE;
@ -4476,19 +4471,6 @@ _gdk_win32_surface_get_scale_factor (GdkSurface *window)
}
}
void
_gdk_win32_surface_get_unscaled_size (GdkSurface *window,
int *unscaled_width,
int *unscaled_height)
{
GdkWin32Surface *impl = GDK_WIN32_SURFACE (window);
if (unscaled_width)
*unscaled_width = impl->unscaled_width;
if (unscaled_height)
*unscaled_height = impl->unscaled_height;
}
static void
gdk_win32_surface_set_input_region (GdkSurface *window,
cairo_region_t *input_region)
@ -4580,11 +4562,8 @@ _gdk_win32_surface_request_layout (GdkSurface *surface)
{
_gdk_win32_get_window_rect (surface, &rect);
impl->unscaled_width = rect.right - rect.left;
impl->unscaled_height = rect.bottom - rect.top;
impl->next_layout.configured_width = (impl->unscaled_width + scale - 1) / scale;
impl->next_layout.configured_height = (impl->unscaled_height + scale - 1) / scale;
impl->next_layout.configured_width = (rect.right - rect.left + scale - 1) / scale;
impl->next_layout.configured_height = (rect.bottom - rect.top + scale - 1) / scale;
surface->x = rect.left / scale;
surface->y = rect.top / scale;
}
@ -4635,7 +4614,6 @@ gdk_win32_surface_class_init (GdkWin32SurfaceClass *klass)
impl_class->drag_begin = _gdk_win32_surface_drag_begin;
impl_class->create_gl_context = _gdk_win32_surface_create_gl_context;
impl_class->get_scale_factor = _gdk_win32_surface_get_scale_factor;
impl_class->get_unscaled_size = _gdk_win32_surface_get_unscaled_size;
impl_class->request_layout = _gdk_win32_surface_request_layout;
impl_class->compute_size = _gdk_win32_surface_compute_size;
}

View File

@ -335,8 +335,6 @@ struct _GdkWin32Surface
/* scale of window on HiDPI */
int surface_scale;
int unscaled_width;
int unscaled_height;
GdkToplevelLayout *toplevel_layout;
struct {

View File

@ -194,20 +194,6 @@ _gdk_x11_surface_update_size (GdkX11Surface *impl)
}
}
static void
gdk_x11_surface_get_unscaled_size (GdkSurface *surface,
int *unscaled_width,
int *unscaled_height)
{
GdkX11Surface *impl = GDK_X11_SURFACE (surface);
if (unscaled_width)
*unscaled_width = impl->unscaled_width;
if (unscaled_height)
*unscaled_height = impl->unscaled_height;
}
static void
update_shadow_size (GdkSurface *surface,
int shadow_left,
@ -4802,7 +4788,6 @@ gdk_x11_surface_class_init (GdkX11SurfaceClass *klass)
impl_class->get_scale_factor = gdk_x11_surface_get_scale_factor;
impl_class->set_opaque_region = gdk_x11_surface_set_opaque_region;
impl_class->create_gl_context = gdk_x11_surface_create_gl_context;
impl_class->get_unscaled_size = gdk_x11_surface_get_unscaled_size;
impl_class->request_layout = gdk_x11_surface_request_layout;
impl_class->compute_size = gdk_x11_surface_compute_size;
}