From 5e519a6ad884e07da7d1c52ac7412f2305097041 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Sat, 30 Jun 2012 15:06:12 +1200 Subject: [PATCH] Bug 539356 - Part 17 - Don't paint widgets that an invisible or empty bounds. r=roc * * * Bug 539356 - Part 13 - Only repaint widgets that have had changes since the last paint --- widget/nsIWidget.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index ac328d1d52d9..4697672d26a3 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -1576,7 +1576,17 @@ class nsIWidget : public nsISupports { if (!mNeedsPaint) { return false; } - return true; + + bool visible; + nsresult rv = IsVisible(visible); + NS_ENSURE_SUCCESS(rv, false); + if (!visible) { + return false; + } + nsIntRect bounds; + rv = GetBounds(bounds); + NS_ENSURE_SUCCESS(rv, false); + return !bounds.IsEmpty(); } protected: