Bug 847002 - Guard against going into codepaths that assume GetLayerManager doesn't return null. r=Cwiiis a=bajaj
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 14 Mar 2013 12:17:49 +0100
changeset 132424 a0e4c1622c7c9e1090f3e8c495c23ee6c5e047cd
parent 132423 a7232156dacee23add5d37de37e3e91c6e71510b
child 132425 9e118768b5220aee488a9a94097912b039d1dc87
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis, bajaj
bugs847002
milestone21.0a2
Bug 847002 - Guard against going into codepaths that assume GetLayerManager doesn't return null. r=Cwiiis a=bajaj
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -992,17 +992,17 @@ nsWindow::DrawTo(gfxASurface *targetSurf
     nsIntRect boundsRect(0, 0, mBounds.width, mBounds.height);
     return DrawTo(targetSurface, boundsRect);
 }
 
 bool
 nsWindow::DrawTo(gfxASurface *targetSurface, const nsIntRect &invalidRect)
 {
     mozilla::layers::RenderTraceScope trace("DrawTo", "717171");
-    if (!mIsVisible || !mWidgetListener)
+    if (!mIsVisible || !mWidgetListener || !GetLayerManager(nullptr))
         return false;
 
     nsRefPtr<nsWindow> kungFuDeathGrip(this);
     nsIntRect boundsRect(0, 0, mBounds.width, mBounds.height);
 
     // Figure out if any of our children cover this widget completely
     int32_t coveringChildIndex = -1;
     for (uint32_t i = 0; i < mChildren.Length(); ++i) {
@@ -2363,15 +2363,15 @@ nsWindow::WidgetPaintsBackground()
     }
 
     return sWidgetPaintsBackground;
 }
 
 bool
 nsWindow::NeedsPaint()
 {
-  if (sCompositorPaused || FindTopLevel() != nsWindow::TopWindow()) {
+  if (sCompositorPaused || FindTopLevel() != nsWindow::TopWindow() || !GetLayerManager(nullptr)) {
     return false;
   }
   return nsIWidget::NeedsPaint();
 }