OSDN Git Service

fix an issue where the screen could stay off
authorMathias Agopian <mathias@google.com>
Tue, 11 Oct 2011 05:18:55 +0000 (22:18 -0700)
committerMathias Agopian <mathias@google.com>
Tue, 11 Oct 2011 05:18:55 +0000 (22:18 -0700)
this would happen when toggling on/off/on very fast, the screen
could stay black (while the panel is on).

Bug: 5429724
Change-Id: Ic8aa6aff066e6267923c0d47ef65e314e7bb6d41

services/surfaceflinger/DisplayHardware/DisplayHardwareBase.cpp
services/surfaceflinger/DisplayHardware/DisplayHardwareBase.h
services/surfaceflinger/SurfaceFlinger.cpp
services/surfaceflinger/SurfaceFlinger.h

index 59b7e5a..3b7c09e 100644 (file)
@@ -122,7 +122,7 @@ status_t DisplayHardwareBase::DisplayEventThread::initCheck() const
 
 DisplayHardwareBase::DisplayHardwareBase(const sp<SurfaceFlinger>& flinger,
         uint32_t displayIndex) 
-    : mCanDraw(true), mScreenAcquired(true)
+    : mScreenAcquired(true)
 {
     mDisplayEventThread = new DisplayEventThread(flinger);
 }
@@ -133,14 +133,9 @@ DisplayHardwareBase::~DisplayHardwareBase()
     mDisplayEventThread->requestExitAndWait();
 }
 
-void DisplayHardwareBase::setCanDraw(bool canDraw)
-{
-    mCanDraw = canDraw;
-}
-
 bool DisplayHardwareBase::canDraw() const
 {
-    return mCanDraw && mScreenAcquired;
+    return mScreenAcquired;
 }
 
 void DisplayHardwareBase::releaseScreen() const
index 3ebc7b6..ef2df43 100644 (file)
@@ -43,7 +43,6 @@ public:
     bool isScreenAcquired() const;
 
     bool canDraw() const;
-    void setCanDraw(bool canDraw);
 
 
 private:
@@ -74,7 +73,6 @@ private:
     };
 
     sp<DisplayEventThreadBase>  mDisplayEventThread;
-    mutable int                 mCanDraw;
     mutable int                 mScreenAcquired;
 };
 
index a778dcb..195ad2e 100644 (file)
@@ -84,7 +84,6 @@ SurfaceFlinger::SurfaceFlinger()
         mBootTime(systemTime()),
         mVisibleRegionsDirty(false),
         mHwWorkListDirty(false),
-        mDeferReleaseConsole(false),
         mFreezeDisplay(false),
         mElectronBeamAnimationMode(0),
         mFreezeCount(0),
@@ -503,17 +502,9 @@ void SurfaceFlinger::handleConsoleEvents()
         SurfaceFlinger::turnElectronBeamOn(mElectronBeamAnimationMode);
     }
 
-    if (mDeferReleaseConsole && hw.isScreenAcquired()) {
-        // We got the release signal before the acquire signal
-        mDeferReleaseConsole = false;
-        hw.releaseScreen();
-    }
-
     if (what & eConsoleReleased) {
         if (hw.isScreenAcquired()) {
             hw.releaseScreen();
-        } else {
-            mDeferReleaseConsole = true;
         }
     }
 
@@ -2177,7 +2168,6 @@ status_t SurfaceFlinger::turnElectronBeamOffImplLocked(int32_t mode)
     glEnable(GL_SCISSOR_TEST);
     hw.flip( Region(hw.bounds()) );
 
-    hw.setCanDraw(false);
     return NO_ERROR;
 }
 
@@ -2226,7 +2216,6 @@ status_t SurfaceFlinger::turnElectronBeamOnImplLocked(int32_t mode)
     if (mode & ISurfaceComposer::eElectronBeamAnimationOn) {
         electronBeamOnAnimationImplLocked();
     }
-    hw.setCanDraw(true);
 
     // make sure to redraw the whole screen when the animation is done
     mDirtyRegion.set(hw.bounds());
index 92b265e..1cb9be2 100644 (file)
@@ -363,7 +363,6 @@ private:
                 Region                      mWormholeRegion;
                 bool                        mVisibleRegionsDirty;
                 bool                        mHwWorkListDirty;
-                bool                        mDeferReleaseConsole;
                 bool                        mFreezeDisplay;
                 int32_t                     mElectronBeamAnimationMode;
                 int32_t                     mFreezeCount;