+ if (window->implicit_paint)
+ {
+ parent_paint = window->implicit_paint->data;
+
+ /* If the toplevel implicit paint was flushed, restore it now
+ before we blend over it. */
+ if (parent_paint->flushed != NULL &&
+ !cairo_region_is_empty (parent_paint->flushed))
+ {
+ cairo_surface_t *source_surface = gdk_window_ref_impl_surface (window);
+ cairo_region_t *flushed = cairo_region_copy (parent_paint->flushed);
+
+ cr = cairo_create (parent_paint->surface);
+ cairo_set_source_surface (cr, source_surface, 0, 0);
+ cairo_surface_destroy (source_surface);
+
+ cairo_region_intersect (flushed, paint->region);
+ gdk_cairo_region (cr, flushed);
+ cairo_clip (cr);
+
+ cairo_region_subtract (parent_paint->flushed, flushed);
+ cairo_region_destroy (flushed);
+
+ cairo_paint (cr);
+ cairo_destroy (cr);
+ }
+
+ cr = cairo_create (parent_paint->surface);
+ }
+ else
+ cr = gdk_cairo_create_for_impl (window);
+