Merge "fix an issue where the screen could stay off"

This commit is contained in:
Mathias Agopian 2011-10-10 22:21:57 -07:00 committed by Android (Google) Code Review
commit e64206915d
4 changed files with 2 additions and 21 deletions

View 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

View 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;
};

View 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());

View File

@ -363,7 +363,6 @@ private:
Region mWormholeRegion;
bool mVisibleRegionsDirty;
bool mHwWorkListDirty;
bool mDeferReleaseConsole;
bool mFreezeDisplay;
int32_t mElectronBeamAnimationMode;
int32_t mFreezeCount;