Commit d0147a6f authored by Alexander Larsson's avatar Alexander Larsson Committed by Matthias Clasen

Add gdk_window_mark_paint_from_clip and call from widget drawing

This is a new function that gets called every time we're drawing
some area in the Gtk paint machinery. It is a no-op right now, but
it will be required later to keep track of what areas which
we previously rendered with GL was overwritten with cairo contents.
parent a8f11835
...@@ -394,6 +394,7 @@ gdk_window_constrain_size ...@@ -394,6 +394,7 @@ gdk_window_constrain_size
gdk_window_beep gdk_window_beep
gdk_window_get_scale_factor gdk_window_get_scale_factor
gdk_window_set_opaque_region gdk_window_set_opaque_region
gdk_window_get_clip_region gdk_window_get_clip_region
...@@ -2813,6 +2813,26 @@ gdk_window_begin_paint_region (GdkWindow *window, ...@@ -2813,6 +2813,26 @@ gdk_window_begin_paint_region (GdkWindow *window,
gdk_window_clear_backing_region (window); gdk_window_clear_backing_region (window);
} }
* gdk_window_mark_paint_from_clip:
* @window: a #GdkWindow
* @cr: a #cairo_t
* If you call this during a paint (e.g. between gdk_window_begin_paint_region()
* and gdk_window_end_paint() then gdk will mark the current clip region of the
* window as being drawn. This is required when mixing GL rendering via
* gdk_cairo_draw_from_gl() and cairo rendering, as otherwise gdk has no way
* of knowing when something paints over the gl drawn regions.
* This is typically called automatically by Gtk and you don't need
* to care about this.
gdk_window_mark_paint_from_clip (GdkWindow *window,
cairo_t *cr)
/** /**
* gdk_window_end_paint: * gdk_window_end_paint:
* @window: a #GdkWindow * @window: a #GdkWindow
...@@ -739,6 +739,9 @@ cairo_region_t *gdk_window_get_visible_region(GdkWindow *window); ...@@ -739,6 +739,9 @@ cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
void gdk_window_begin_paint_rect (GdkWindow *window, void gdk_window_begin_paint_rect (GdkWindow *window,
const GdkRectangle *rectangle); const GdkRectangle *rectangle);
void gdk_window_mark_paint_from_clip (GdkWindow *window,
cairo_t *cr);
void gdk_window_begin_paint_region (GdkWindow *window, void gdk_window_begin_paint_region (GdkWindow *window,
const cairo_region_t *region); const cairo_region_t *region);
...@@ -6948,6 +6948,8 @@ _gtk_widget_draw_internal (GtkWidget *widget, ...@@ -6948,6 +6948,8 @@ _gtk_widget_draw_internal (GtkWidget *widget,
{ {
gboolean result; gboolean result;
gdk_window_mark_paint_from_clip (window, cr);
g_signal_emit (widget, widget_signals[DRAW], g_signal_emit (widget, widget_signals[DRAW],
0, cr, 0, cr,
&result); &result);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment