Loading include/surfaceflinger/ISurfaceComposer.h +5 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,11 @@ public: eOrientationSwapMask = 0x01 }; enum { eElectronBeamAnimationOn = 0x01, eElectronBeamAnimationOff = 0x10 }; // flags for setOrientation enum { eOrientationAnimationDisable = 0x00000001 Loading services/surfaceflinger/SurfaceFlinger.cpp +29 −16 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ SurfaceFlinger::SurfaceFlinger() mVisibleRegionsDirty(false), mDeferReleaseConsole(false), mFreezeDisplay(false), mElectronBeamAnimation(false), mElectronBeamAnimationMode(0), mFreezeCount(0), mFreezeDisplayTime(0), mDebugRegion(0), Loading Loading @@ -424,8 +424,7 @@ void SurfaceFlinger::handleConsoleEvents() hw.acquireScreen(); // this is a temporary work-around, eventually this should be called // by the power-manager if (mElectronBeamAnimation) SurfaceFlinger::turnElectronBeamOn(0); SurfaceFlinger::turnElectronBeamOn(mElectronBeamAnimationMode); } if (mDeferReleaseConsole && hw.isScreenAcquired()) { Loading Loading @@ -1901,14 +1900,24 @@ status_t SurfaceFlinger::electronBeamOnAnimationImplLocked() // --------------------------------------------------------------------------- status_t SurfaceFlinger::turnElectronBeamOffImplLocked() status_t SurfaceFlinger::turnElectronBeamOffImplLocked(int32_t mode) { DisplayHardware& hw(graphicPlane(0).editDisplayHardware()); if (!hw.canDraw()) { // we're already off return NO_ERROR; } if (mode & ISurfaceComposer::eElectronBeamAnimationOff) { electronBeamOffAnimationImplLocked(); } // always clear the whole screen at the end of the animation glClearColor(0,0,0,1); glDisable(GL_SCISSOR_TEST); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_SCISSOR_TEST); hw.flip( Region(hw.bounds()) ); hw.setCanDraw(false); return NO_ERROR; } Loading @@ -1917,22 +1926,23 @@ status_t SurfaceFlinger::turnElectronBeamOff(int32_t mode) { class MessageTurnElectronBeamOff : public MessageBase { SurfaceFlinger* flinger; int32_t mode; status_t result; public: MessageTurnElectronBeamOff(SurfaceFlinger* flinger) : flinger(flinger), result(PERMISSION_DENIED) { MessageTurnElectronBeamOff(SurfaceFlinger* flinger, int32_t mode) : flinger(flinger), mode(mode), result(PERMISSION_DENIED) { } status_t getResult() const { return result; } virtual bool handler() { Mutex::Autolock _l(flinger->mStateLock); result = flinger->turnElectronBeamOffImplLocked(); result = flinger->turnElectronBeamOffImplLocked(mode); return true; } }; sp<MessageBase> msg = new MessageTurnElectronBeamOff(this); sp<MessageBase> msg = new MessageTurnElectronBeamOff(this, mode); status_t res = postMessageSync(msg); if (res == NO_ERROR) { res = static_cast<MessageTurnElectronBeamOff*>( msg.get() )->getResult(); Loading @@ -1940,21 +1950,23 @@ status_t SurfaceFlinger::turnElectronBeamOff(int32_t mode) // work-around: when the power-manager calls us we activate the // animation. eventually, the "on" animation will be called // by the power-manager itself mElectronBeamAnimation = true; mElectronBeamAnimationMode = mode; } return res; } // --------------------------------------------------------------------------- status_t SurfaceFlinger::turnElectronBeamOnImplLocked() status_t SurfaceFlinger::turnElectronBeamOnImplLocked(int32_t mode) { DisplayHardware& hw(graphicPlane(0).editDisplayHardware()); if (hw.canDraw()) { // we're already on return NO_ERROR; } if (mode & ISurfaceComposer::eElectronBeamAnimationOn) { electronBeamOnAnimationImplLocked(); } hw.setCanDraw(true); // make sure to redraw the whole screen when the animation is done Loading @@ -1968,22 +1980,23 @@ status_t SurfaceFlinger::turnElectronBeamOn(int32_t mode) { class MessageTurnElectronBeamOn : public MessageBase { SurfaceFlinger* flinger; int32_t mode; status_t result; public: MessageTurnElectronBeamOn(SurfaceFlinger* flinger) : flinger(flinger), result(PERMISSION_DENIED) { MessageTurnElectronBeamOn(SurfaceFlinger* flinger, int32_t mode) : flinger(flinger), mode(mode), result(PERMISSION_DENIED) { } status_t getResult() const { return result; } virtual bool handler() { Mutex::Autolock _l(flinger->mStateLock); result = flinger->turnElectronBeamOnImplLocked(); result = flinger->turnElectronBeamOnImplLocked(mode); return true; } }; postMessageAsync( new MessageTurnElectronBeamOn(this) ); postMessageAsync( new MessageTurnElectronBeamOn(this, mode) ); return NO_ERROR; } Loading services/surfaceflinger/SurfaceFlinger.h +3 −3 Original line number Diff line number Diff line Loading @@ -328,8 +328,8 @@ private: uint32_t* width, uint32_t* height, PixelFormat* format, uint32_t reqWidth = 0, uint32_t reqHeight = 0); status_t turnElectronBeamOffImplLocked(); status_t turnElectronBeamOnImplLocked(); status_t turnElectronBeamOffImplLocked(int32_t mode); status_t turnElectronBeamOnImplLocked(int32_t mode); status_t electronBeamOffAnimationImplLocked(); status_t electronBeamOnAnimationImplLocked(); status_t renderScreenToTextureLocked(DisplayID dpy, Loading Loading @@ -395,7 +395,7 @@ private: bool mVisibleRegionsDirty; bool mDeferReleaseConsole; bool mFreezeDisplay; bool mElectronBeamAnimation; int32_t mElectronBeamAnimationMode; int32_t mFreezeCount; nsecs_t mFreezeDisplayTime; Vector< sp<LayerBase> > mVisibleLayersSortedByZ; Loading Loading
include/surfaceflinger/ISurfaceComposer.h +5 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,11 @@ public: eOrientationSwapMask = 0x01 }; enum { eElectronBeamAnimationOn = 0x01, eElectronBeamAnimationOff = 0x10 }; // flags for setOrientation enum { eOrientationAnimationDisable = 0x00000001 Loading
services/surfaceflinger/SurfaceFlinger.cpp +29 −16 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ SurfaceFlinger::SurfaceFlinger() mVisibleRegionsDirty(false), mDeferReleaseConsole(false), mFreezeDisplay(false), mElectronBeamAnimation(false), mElectronBeamAnimationMode(0), mFreezeCount(0), mFreezeDisplayTime(0), mDebugRegion(0), Loading Loading @@ -424,8 +424,7 @@ void SurfaceFlinger::handleConsoleEvents() hw.acquireScreen(); // this is a temporary work-around, eventually this should be called // by the power-manager if (mElectronBeamAnimation) SurfaceFlinger::turnElectronBeamOn(0); SurfaceFlinger::turnElectronBeamOn(mElectronBeamAnimationMode); } if (mDeferReleaseConsole && hw.isScreenAcquired()) { Loading Loading @@ -1901,14 +1900,24 @@ status_t SurfaceFlinger::electronBeamOnAnimationImplLocked() // --------------------------------------------------------------------------- status_t SurfaceFlinger::turnElectronBeamOffImplLocked() status_t SurfaceFlinger::turnElectronBeamOffImplLocked(int32_t mode) { DisplayHardware& hw(graphicPlane(0).editDisplayHardware()); if (!hw.canDraw()) { // we're already off return NO_ERROR; } if (mode & ISurfaceComposer::eElectronBeamAnimationOff) { electronBeamOffAnimationImplLocked(); } // always clear the whole screen at the end of the animation glClearColor(0,0,0,1); glDisable(GL_SCISSOR_TEST); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_SCISSOR_TEST); hw.flip( Region(hw.bounds()) ); hw.setCanDraw(false); return NO_ERROR; } Loading @@ -1917,22 +1926,23 @@ status_t SurfaceFlinger::turnElectronBeamOff(int32_t mode) { class MessageTurnElectronBeamOff : public MessageBase { SurfaceFlinger* flinger; int32_t mode; status_t result; public: MessageTurnElectronBeamOff(SurfaceFlinger* flinger) : flinger(flinger), result(PERMISSION_DENIED) { MessageTurnElectronBeamOff(SurfaceFlinger* flinger, int32_t mode) : flinger(flinger), mode(mode), result(PERMISSION_DENIED) { } status_t getResult() const { return result; } virtual bool handler() { Mutex::Autolock _l(flinger->mStateLock); result = flinger->turnElectronBeamOffImplLocked(); result = flinger->turnElectronBeamOffImplLocked(mode); return true; } }; sp<MessageBase> msg = new MessageTurnElectronBeamOff(this); sp<MessageBase> msg = new MessageTurnElectronBeamOff(this, mode); status_t res = postMessageSync(msg); if (res == NO_ERROR) { res = static_cast<MessageTurnElectronBeamOff*>( msg.get() )->getResult(); Loading @@ -1940,21 +1950,23 @@ status_t SurfaceFlinger::turnElectronBeamOff(int32_t mode) // work-around: when the power-manager calls us we activate the // animation. eventually, the "on" animation will be called // by the power-manager itself mElectronBeamAnimation = true; mElectronBeamAnimationMode = mode; } return res; } // --------------------------------------------------------------------------- status_t SurfaceFlinger::turnElectronBeamOnImplLocked() status_t SurfaceFlinger::turnElectronBeamOnImplLocked(int32_t mode) { DisplayHardware& hw(graphicPlane(0).editDisplayHardware()); if (hw.canDraw()) { // we're already on return NO_ERROR; } if (mode & ISurfaceComposer::eElectronBeamAnimationOn) { electronBeamOnAnimationImplLocked(); } hw.setCanDraw(true); // make sure to redraw the whole screen when the animation is done Loading @@ -1968,22 +1980,23 @@ status_t SurfaceFlinger::turnElectronBeamOn(int32_t mode) { class MessageTurnElectronBeamOn : public MessageBase { SurfaceFlinger* flinger; int32_t mode; status_t result; public: MessageTurnElectronBeamOn(SurfaceFlinger* flinger) : flinger(flinger), result(PERMISSION_DENIED) { MessageTurnElectronBeamOn(SurfaceFlinger* flinger, int32_t mode) : flinger(flinger), mode(mode), result(PERMISSION_DENIED) { } status_t getResult() const { return result; } virtual bool handler() { Mutex::Autolock _l(flinger->mStateLock); result = flinger->turnElectronBeamOnImplLocked(); result = flinger->turnElectronBeamOnImplLocked(mode); return true; } }; postMessageAsync( new MessageTurnElectronBeamOn(this) ); postMessageAsync( new MessageTurnElectronBeamOn(this, mode) ); return NO_ERROR; } Loading
services/surfaceflinger/SurfaceFlinger.h +3 −3 Original line number Diff line number Diff line Loading @@ -328,8 +328,8 @@ private: uint32_t* width, uint32_t* height, PixelFormat* format, uint32_t reqWidth = 0, uint32_t reqHeight = 0); status_t turnElectronBeamOffImplLocked(); status_t turnElectronBeamOnImplLocked(); status_t turnElectronBeamOffImplLocked(int32_t mode); status_t turnElectronBeamOnImplLocked(int32_t mode); status_t electronBeamOffAnimationImplLocked(); status_t electronBeamOnAnimationImplLocked(); status_t renderScreenToTextureLocked(DisplayID dpy, Loading Loading @@ -395,7 +395,7 @@ private: bool mVisibleRegionsDirty; bool mDeferReleaseConsole; bool mFreezeDisplay; bool mElectronBeamAnimation; int32_t mElectronBeamAnimationMode; int32_t mFreezeCount; nsecs_t mFreezeDisplayTime; Vector< sp<LayerBase> > mVisibleLayersSortedByZ; Loading