gdk_draw_context_get_surface
gdk_draw_context_begin_frame
gdk_draw_context_end_frame
+gdk_draw_context_in_frame
gdk_draw_context_get_frame_region
<SUBSECTION Standard>
g_return_val_if_fail (GDK_IS_CAIRO_CONTEXT (self), NULL);
context = GDK_DRAW_CONTEXT (self);
- if (!gdk_draw_context_is_drawing (context))
+ if (!gdk_draw_context_is_in_frame (context))
return NULL;
surface = gdk_draw_context_get_surface (context);
{
}
-/*< private >
- * gdk_draw_context_is_drawing:
+/**
+ * gdk_draw_context_is_in_frame:
* @context: a #GdkDrawContext
*
- * Returns %TRUE if @context is in the process of drawing to its surface. In such
- * cases, it will have access to the surface's backbuffer to render the new frame
- * onto it.
+ * Returns %TRUE if @context is in the process of drawing to its surface
+ * after a call to gdk_draw_context_begin_frame() and not yet having called
+ * gdk_draw_context_end_frame().
+ * In this situation, drawing commands may be effecting the contents of a
+ * @context's surface.
*
* Returns: %TRUE if the context is between begin_frame() and end_frame() calls.
*/
gboolean
-gdk_draw_context_is_drawing (GdkDrawContext *context)
+gdk_draw_context_is_in_frame (GdkDrawContext *context)
{
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
+ g_return_val_if_fail (GDK_IS_DRAW_CONTEXT (context), FALSE);
+
return priv->frame_region != NULL;
}
GDK_AVAILABLE_IN_ALL
void gdk_draw_context_end_frame (GdkDrawContext *context);
GDK_AVAILABLE_IN_ALL
+gboolean gdk_draw_context_is_in_frame (GdkDrawContext *context);
+GDK_AVAILABLE_IN_ALL
const cairo_region_t * gdk_draw_context_get_frame_region (GdkDrawContext *context);
G_END_DECLS
void (* surface_resized) (GdkDrawContext *context);
};
-gboolean gdk_draw_context_is_drawing (GdkDrawContext *context);
-
void gdk_draw_context_surface_resized (GdkDrawContext *context);
G_END_DECLS
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_VULKAN_CONTEXT (context), 0);
- g_return_val_if_fail (gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context)), 0);
+ g_return_val_if_fail (gdk_draw_context_is_in_frame (GDK_DRAW_CONTEXT (context)), 0);
return priv->draw_index;
}
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_VULKAN_CONTEXT (context), VK_NULL_HANDLE);
- g_return_val_if_fail (gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context)), VK_NULL_HANDLE);
+ g_return_val_if_fail (gdk_draw_context_is_in_frame (GDK_DRAW_CONTEXT (context)), VK_NULL_HANDLE);
return priv->draw_semaphore;
}
context_wayland = GDK_WAYLAND_GL_CONTEXT (context);
surface = gdk_gl_context_get_surface (context);
- if (context_wayland->is_attached || gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context)))
+ if (context_wayland->is_attached || gdk_draw_context_is_in_frame (GDK_DRAW_CONTEXT (context)))
egl_surface = gdk_wayland_surface_get_egl_surface (surface->impl_surface, context_wayland->egl_config);
else
{
return FALSE;
}
- if (context_x11->is_attached || gdk_draw_context_is_drawing (GDK_DRAW_CONTEXT (context)))
+ if (context_x11->is_attached || gdk_draw_context_is_in_frame (GDK_DRAW_CONTEXT (context)))
drawable = context_x11->attached_drawable;
else
drawable = context_x11->unattached_drawable;