diff options
author | Benjamin Otte <otte@redhat.com> | 2020-02-12 23:45:51 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2020-02-13 07:36:38 +0100 |
commit | 052d0f6e6004b7c791cfbb891c70ab0bb316c228 (patch) | |
tree | 181c4587a0a2b205e1433bc143ab6564bf160200 /gdk/gdkcairo.c | |
parent | 8f6cab656082c9a5c3989f355bd5385d4439edd3 (diff) | |
download | gtk+-052d0f6e6004b7c791cfbb891c70ab0bb316c228.tar.gz |
gdk: Remove gdk_cairo_get_clip_rectangle()
The function is fundamentally broken for unbounded surfaces.
If a surface is unbounded, we cannot represent this as a
cairo_rectangle_int_t, and using the return value doesn't work because
it's already used for something else.
In GTK3, unbounded surfaces aren't a problem, but GTK4 uses recording
surfaces.
So better remove that function before we keep using it and using it
wrong.
Diffstat (limited to 'gdk/gdkcairo.c')
-rw-r--r-- | gdk/gdkcairo.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c index c5917cfeb9..e9fcdff086 100644 --- a/gdk/gdkcairo.c +++ b/gdk/gdkcairo.c @@ -40,45 +40,6 @@ /** - * gdk_cairo_get_clip_rectangle: - * @cr: a cairo context - * @rect: (out) (allow-none): return location for the clip, or %NULL - * - * This is a convenience function around cairo_clip_extents(). - * It rounds the clip extents to integer coordinates and returns - * a boolean indicating if a clip area exists. - * - * Returns: %TRUE if a clip rectangle exists, %FALSE if all of @cr is - * clipped and all drawing can be skipped - */ -gboolean -gdk_cairo_get_clip_rectangle (cairo_t *cr, - GdkRectangle *rect) -{ - double x1, y1, x2, y2; - gboolean clip_exists; - - cairo_clip_extents (cr, &x1, &y1, &x2, &y2); - - clip_exists = x1 < x2 && y1 < y2; - - if (rect) - { - x1 = floor (x1); - y1 = floor (y1); - x2 = ceil (x2); - y2 = ceil (y2); - - rect->x = CLAMP (x1, G_MININT, G_MAXINT); - rect->y = CLAMP (y1, G_MININT, G_MAXINT); - rect->width = CLAMP (x2 - x1, G_MININT, G_MAXINT); - rect->height = CLAMP (y2 - y1, G_MININT, G_MAXINT); - } - - return clip_exists; -} - -/** * gdk_cairo_set_source_rgba: * @cr: a cairo context * @rgba: a #GdkRGBA |