diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index b8624b3993fa..75d51bfffb91 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -2336,5 +2336,14 @@ nsWindow::WidgetPaintsBackground() return sWidgetPaintsBackground; } +bool +nsWindow::NeedsPaint() +{ + if (sCompositorPaused || FindTopLevel() != nsWindow::TopWindow()) { + return false; + } + return nsIWidget::NeedsPaint(); +} + #endif diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h index af7a21f4529f..2a6bc52357f0 100644 --- a/widget/android/nsWindow.h +++ b/widget/android/nsWindow.h @@ -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); diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 4697672d26a3..21e6b972289c 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -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; }