gdkwindow: Don't create a subsurface if we don't need to

In the case we have a native window, we don't need to crop it to a
non-native subrectangle, as abs_x / abs_y / width / height are all 0.
This commit is contained in:
Jasper St. Pierre 2014-06-20 20:46:49 -04:00
parent be30e440c3
commit d619a78aeb

View File

@ -3004,11 +3004,18 @@ _gdk_window_ref_cairo_surface (GdkWindow *window)
surface = get_window_surface (window);
if (gdk_window_has_impl (window))
{
return surface;
}
else
{
return cairo_surface_create_for_rectangle (surface,
window->abs_x,
window->abs_y,
window->width,
window->height);
}
}
/**