summaryrefslogtreecommitdiff
path: root/gdk/gdkdrawcontext.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-04-21 00:47:35 +0200
committerBenjamin Otte <otte@redhat.com>2018-04-24 23:16:58 +0200
commitdbe4f1d766f0c571ea0d778cd561929c19e63c94 (patch)
tree75f7ad7544e71e4c909e340bfc72804ca946d9a1 /gdk/gdkdrawcontext.c
parente7d6648f4618ec9fb44aa218d6965e1d613718c2 (diff)
downloadgtk+-dbe4f1d766f0c571ea0d778cd561929c19e63c94.tar.gz
gdk: Add gdk_draw_context_get_frame_region()
This does the same as gdk_drawing_context_get_clip().
Diffstat (limited to 'gdk/gdkdrawcontext.c')
-rw-r--r--gdk/gdkdrawcontext.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c
index 33324f44e3..45a353b086 100644
--- a/gdk/gdkdrawcontext.c
+++ b/gdk/gdkdrawcontext.c
@@ -303,3 +303,26 @@ gdk_draw_context_get_surface (GdkDrawContext *context)
return priv->surface;
}
+/**
+ * gdk_draw_context_get_frame_region:
+ * @context: a #GdkDrawContext
+ *
+ * Retrieves the region that is currently in the process of being repainted.
+ *
+ * After a call to gdk_draw_context_begin_frame() this function will return
+ * a union of the region passed to that function and the area of the surface
+ * that the @context determined needs to be repainted.
+ *
+ * If @context is not inbetween calls to gdk_draw_context_begin_frame() and
+ * gdk_draw_context_end_frame(), %NULL will be returned.
+ *
+ * Returns: (transfer none) (nullable): a Cairo region or %NULL if not drawing
+ * a frame.
+ */
+const cairo_region_t *
+gdk_draw_context_get_frame_region (GdkDrawContext *context)
+{
+ g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), NULL);
+
+ return context->frame_region;
+}