widget: Improve early exit checks on queue_draw()

(1) We don't need to check for realized when we check for mapped right
    below.
(2) Empty regions don't need to be drawn.
This commit is contained in:
Benjamin Otte 2016-10-18 03:49:09 +02:00
parent 52c4421bd3
commit 3fd63e1d67

View File

@ -5067,7 +5067,7 @@ gtk_widget_queue_draw_region (GtkWidget *widget,
g_return_if_fail (GTK_IS_WIDGET (widget));
if (!_gtk_widget_get_realized (widget))
if (cairo_region_is_empty (region))
return;
/* Just return if the widget or one of its ancestors isn't mapped */