Bug 708191 - Don't draw when the screen is off on gonk, r=cjones
authorMichael Wu <mwu@mozilla.com>
Tue, 17 Jan 2012 02:55:25 -0800
changeset 86050 80d20ea83b92c09c716146e384c84a3fdfbf6bf4
parent 86049 6d074e0ec7c416a8b0ff9f5c19505434ee214416
child 86051 0fcee05b6e0ace1a8d7ef57fd7f677df7fc23160
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs708191
milestone12.0a1
Bug 708191 - Don't draw when the screen is off on gonk, r=cjones
widget/gonk/nsWindow.cpp
--- a/widget/gonk/nsWindow.cpp
+++ b/widget/gonk/nsWindow.cpp
@@ -36,16 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
 
 #include "android/log.h"
 #include "ui/FramebufferNativeWindow.h"
 
+#include "mozilla/Hal.h"
 #include "Framebuffer.h"
 #include "gfxContext.h"
 #include "gfxUtils.h"
 #include "GLContextProvider.h"
 #include "LayerManagerOGL.h"
 #include "nsAutoPtr.h"
 #include "nsAppShell.h"
 #include "nsTArray.h"
@@ -96,16 +97,21 @@ nsWindow::nsWindow()
 
 nsWindow::~nsWindow()
 {
 }
 
 void
 nsWindow::DoDraw(void)
 {
+    if (!hal::GetScreenEnabled()) {
+        gDrawRequest = true;
+        return;
+    }
+
     if (!gWindowToRedraw) {
         LOG("  no window to draw, bailing");
         return;
     }
 
     nsPaintEvent event(true, NS_PAINT, gWindowToRedraw);
     event.region = gWindowToRedraw->mDirtyRegion;
     gWindowToRedraw->mDirtyRegion.SetEmpty();