Bug 539356 - Part 24 - Don't paint android widgets that aren't being composited, or at the front. r=roc

This commit is contained in:
Matt Woodrow 2012-06-30 15:06:13 +12:00
parent f132718f0c
commit e0bc87022c
3 changed files with 11 additions and 1 deletions

View File

@ -2336,5 +2336,14 @@ nsWindow::WidgetPaintsBackground()
return sWidgetPaintsBackground;
}
bool
nsWindow::NeedsPaint()
{
if (sCompositorPaused || FindTopLevel() != nsWindow::TopWindow()) {
return false;
}
return nsIWidget::NeedsPaint();
}
#endif

View File

@ -148,6 +148,7 @@ public:
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent);
#ifdef MOZ_JAVA_COMPOSITOR
virtual bool NeedsPaint();
virtual void DrawWindowUnderlay(LayerManager* aManager, nsIntRect aRect);
virtual void DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect);

View File

@ -1572,7 +1572,7 @@ class nsIWidget : public nsISupports {
virtual bool WidgetPaintsBackground() { return false; }
void SetNeedsPaint(bool aNeedsPaint) { mNeedsPaint = aNeedsPaint; }
bool NeedsPaint() {
virtual bool NeedsPaint() {
if (!mNeedsPaint) {
return false;
}