forked from AuroraMiddleware/gtk
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:
parent
be30e440c3
commit
d619a78aeb
@ -3004,11 +3004,18 @@ _gdk_window_ref_cairo_surface (GdkWindow *window)
|
||||
|
||||
surface = get_window_surface (window);
|
||||
|
||||
return cairo_surface_create_for_rectangle (surface,
|
||||
window->abs_x,
|
||||
window->abs_y,
|
||||
window->width,
|
||||
window->height);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user