Loading include/gui/SurfaceComposerClient.h +15 −5 Original line number Original line Diff line number Diff line Loading @@ -121,11 +121,21 @@ public: const sp<ISurfaceTexture>& surface); const sp<ISurfaceTexture>& surface); static void setDisplayLayerStack(const sp<IBinder>& token, static void setDisplayLayerStack(const sp<IBinder>& token, uint32_t layerStack); uint32_t layerStack); static void setDisplayOrientation(const sp<IBinder>& token, uint32_t orientation); /* setDisplayProjection() defines the projection of layer stacks static void setDisplayViewport(const sp<IBinder>& token, * to a given display. const Rect& viewport); * static void setDisplayFrame(const sp<IBinder>& token, const Rect& frame); * - orientation defines the display's orientation. * - layerStackRect defines which area of the window manager coordinate * space will be used. * - displayRect defines where on the display will layerStackRect be * mapped to. displayRect is specified post-orientation, that is * it uses the orientation seen by the end-user. */ static void setDisplayProjection(const sp<IBinder>& token, uint32_t orientation, const Rect& layerStackRect, const Rect& displayRect); private: private: virtual void onFirstRef(); virtual void onFirstRef(); Loading include/private/gui/LayerState.h +3 −5 Original line number Original line Diff line number Diff line Loading @@ -109,9 +109,7 @@ struct DisplayState { enum { enum { eSurfaceChanged = 0x01, eSurfaceChanged = 0x01, eLayerStackChanged = 0x02, eLayerStackChanged = 0x02, eOrientationChanged = 0x04, eDisplayProjectionChanged = 0x04 eViewportChanged = 0x08, eFrameChanged = 0x10 }; }; uint32_t what; uint32_t what; Loading libs/gui/SurfaceComposerClient.cpp +17 −43 Original line number Original line Diff line number Diff line Loading @@ -119,9 +119,10 @@ public: void setDisplaySurface(const sp<IBinder>& token, const sp<ISurfaceTexture>& surface); void setDisplaySurface(const sp<IBinder>& token, const sp<ISurfaceTexture>& surface); void setDisplayLayerStack(const sp<IBinder>& token, uint32_t layerStack); void setDisplayLayerStack(const sp<IBinder>& token, uint32_t layerStack); void setDisplayOrientation(const sp<IBinder>& token, uint32_t orientation); void setDisplayProjection(const sp<IBinder>& token, void setDisplayViewport(const sp<IBinder>& token, const Rect& viewport); uint32_t orientation, void setDisplayFrame(const sp<IBinder>& token, const Rect& frame); const Rect& layerStackRect, const Rect& displayRect); static void closeGlobalTransaction(bool synchronous) { static void closeGlobalTransaction(bool synchronous) { Composer::getInstance().closeGlobalTransactionImpl(synchronous); Composer::getInstance().closeGlobalTransactionImpl(synchronous); Loading Loading @@ -326,39 +327,19 @@ void Composer::setDisplayLayerStack(const sp<IBinder>& token, s.what |= DisplayState::eLayerStackChanged; s.what |= DisplayState::eLayerStackChanged; } } void Composer::setDisplayOrientation(const sp<IBinder>& token, void Composer::setDisplayProjection(const sp<IBinder>& token, uint32_t orientation) { uint32_t orientation, const Rect& layerStackRect, const Rect& displayRect) { Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); DisplayState& s(getDisplayStateLocked(token)); s.orientation = orientation; s.orientation = orientation; s.what |= DisplayState::eOrientationChanged; s.viewport = layerStackRect; s.frame = displayRect; s.what |= DisplayState::eDisplayProjectionChanged; mForceSynchronous = true; // TODO: do we actually still need this? mForceSynchronous = true; // TODO: do we actually still need this? } } // FIXME: get rid of this eventually status_t Composer::setOrientation(int orientation) { sp<ISurfaceComposer> sm(ComposerService::getComposerService()); sp<IBinder> token(sm->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); Composer::setDisplayOrientation(token, orientation); return NO_ERROR; } void Composer::setDisplayViewport(const sp<IBinder>& token, const Rect& viewport) { Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); s.viewport = viewport; s.what |= DisplayState::eViewportChanged; } void Composer::setDisplayFrame(const sp<IBinder>& token, const Rect& frame) { Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); s.frame = frame; s.what |= DisplayState::eFrameChanged; } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- SurfaceComposerClient::SurfaceComposerClient() SurfaceComposerClient::SurfaceComposerClient() Loading Loading @@ -520,19 +501,12 @@ void SurfaceComposerClient::setDisplayLayerStack(const sp<IBinder>& token, Composer::getInstance().setDisplayLayerStack(token, layerStack); Composer::getInstance().setDisplayLayerStack(token, layerStack); } } void SurfaceComposerClient::setDisplayOrientation(const sp<IBinder>& token, void SurfaceComposerClient::setDisplayProjection(const sp<IBinder>& token, uint32_t orientation) { uint32_t orientation, Composer::getInstance().setDisplayOrientation(token, orientation); const Rect& layerStackRect, } const Rect& displayRect) { Composer::getInstance().setDisplayProjection(token, orientation, void SurfaceComposerClient::setDisplayViewport(const sp<IBinder>& token, layerStackRect, displayRect); const Rect& viewport) { Composer::getInstance().setDisplayViewport(token, viewport); } void SurfaceComposerClient::setDisplayFrame(const sp<IBinder>& token, const Rect& frame) { Composer::getInstance().setDisplayFrame(token, frame); } } // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading services/surfaceflinger/DisplayDevice.cpp +5 −16 Original line number Original line Diff line number Diff line Loading @@ -150,7 +150,7 @@ void DisplayDevice::init(EGLConfig config) mHwcDisplayId = mFlinger->allocateHwcDisplayId(mType); mHwcDisplayId = mFlinger->allocateHwcDisplayId(mType); // initialize the display orientation transform. // initialize the display orientation transform. DisplayDevice::setOrientation(DisplayState::eOrientationDefault); setProjection(DisplayState::eOrientationDefault, mViewport, mFrame); } } uint32_t DisplayDevice::getPageFlipCount() const { uint32_t DisplayDevice::getPageFlipCount() const { Loading Loading @@ -298,24 +298,13 @@ status_t DisplayDevice::orientationToTransfrom( return NO_ERROR; return NO_ERROR; } } void DisplayDevice::setOrientation(int orientation) { void DisplayDevice::setProjection(int orientation, const Rect& viewport, const Rect& frame) { mOrientation = orientation; mOrientation = orientation; updateGeometryTransform(); } void DisplayDevice::setViewport(const Rect& viewport) { if (viewport.isValid()) { mViewport = viewport; mViewport = viewport; updateGeometryTransform(); } } void DisplayDevice::setFrame(const Rect& frame) { if (frame.isValid()) { mFrame = frame; mFrame = frame; updateGeometryTransform(); updateGeometryTransform(); } } } void DisplayDevice::updateGeometryTransform() { void DisplayDevice::updateGeometryTransform() { int w = mDisplayWidth; int w = mDisplayWidth; Loading services/surfaceflinger/DisplayDevice.h +1 −3 Original line number Original line Diff line number Diff line Loading @@ -94,9 +94,7 @@ public: Region getDirtyRegion(bool repaintEverything) const; Region getDirtyRegion(bool repaintEverything) const; void setLayerStack(uint32_t stack); void setLayerStack(uint32_t stack); void setOrientation(int orientation); void setProjection(int orientation, const Rect& viewport, const Rect& frame); void setViewport(const Rect& viewport); void setFrame(const Rect& frame); int getOrientation() const { return mOrientation; } int getOrientation() const { return mOrientation; } const Transform& getTransform() const { return mGlobalTransform; } const Transform& getTransform() const { return mGlobalTransform; } Loading Loading
include/gui/SurfaceComposerClient.h +15 −5 Original line number Original line Diff line number Diff line Loading @@ -121,11 +121,21 @@ public: const sp<ISurfaceTexture>& surface); const sp<ISurfaceTexture>& surface); static void setDisplayLayerStack(const sp<IBinder>& token, static void setDisplayLayerStack(const sp<IBinder>& token, uint32_t layerStack); uint32_t layerStack); static void setDisplayOrientation(const sp<IBinder>& token, uint32_t orientation); /* setDisplayProjection() defines the projection of layer stacks static void setDisplayViewport(const sp<IBinder>& token, * to a given display. const Rect& viewport); * static void setDisplayFrame(const sp<IBinder>& token, const Rect& frame); * - orientation defines the display's orientation. * - layerStackRect defines which area of the window manager coordinate * space will be used. * - displayRect defines where on the display will layerStackRect be * mapped to. displayRect is specified post-orientation, that is * it uses the orientation seen by the end-user. */ static void setDisplayProjection(const sp<IBinder>& token, uint32_t orientation, const Rect& layerStackRect, const Rect& displayRect); private: private: virtual void onFirstRef(); virtual void onFirstRef(); Loading
include/private/gui/LayerState.h +3 −5 Original line number Original line Diff line number Diff line Loading @@ -109,9 +109,7 @@ struct DisplayState { enum { enum { eSurfaceChanged = 0x01, eSurfaceChanged = 0x01, eLayerStackChanged = 0x02, eLayerStackChanged = 0x02, eOrientationChanged = 0x04, eDisplayProjectionChanged = 0x04 eViewportChanged = 0x08, eFrameChanged = 0x10 }; }; uint32_t what; uint32_t what; Loading
libs/gui/SurfaceComposerClient.cpp +17 −43 Original line number Original line Diff line number Diff line Loading @@ -119,9 +119,10 @@ public: void setDisplaySurface(const sp<IBinder>& token, const sp<ISurfaceTexture>& surface); void setDisplaySurface(const sp<IBinder>& token, const sp<ISurfaceTexture>& surface); void setDisplayLayerStack(const sp<IBinder>& token, uint32_t layerStack); void setDisplayLayerStack(const sp<IBinder>& token, uint32_t layerStack); void setDisplayOrientation(const sp<IBinder>& token, uint32_t orientation); void setDisplayProjection(const sp<IBinder>& token, void setDisplayViewport(const sp<IBinder>& token, const Rect& viewport); uint32_t orientation, void setDisplayFrame(const sp<IBinder>& token, const Rect& frame); const Rect& layerStackRect, const Rect& displayRect); static void closeGlobalTransaction(bool synchronous) { static void closeGlobalTransaction(bool synchronous) { Composer::getInstance().closeGlobalTransactionImpl(synchronous); Composer::getInstance().closeGlobalTransactionImpl(synchronous); Loading Loading @@ -326,39 +327,19 @@ void Composer::setDisplayLayerStack(const sp<IBinder>& token, s.what |= DisplayState::eLayerStackChanged; s.what |= DisplayState::eLayerStackChanged; } } void Composer::setDisplayOrientation(const sp<IBinder>& token, void Composer::setDisplayProjection(const sp<IBinder>& token, uint32_t orientation) { uint32_t orientation, const Rect& layerStackRect, const Rect& displayRect) { Mutex::Autolock _l(mLock); Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); DisplayState& s(getDisplayStateLocked(token)); s.orientation = orientation; s.orientation = orientation; s.what |= DisplayState::eOrientationChanged; s.viewport = layerStackRect; s.frame = displayRect; s.what |= DisplayState::eDisplayProjectionChanged; mForceSynchronous = true; // TODO: do we actually still need this? mForceSynchronous = true; // TODO: do we actually still need this? } } // FIXME: get rid of this eventually status_t Composer::setOrientation(int orientation) { sp<ISurfaceComposer> sm(ComposerService::getComposerService()); sp<IBinder> token(sm->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain)); Composer::setDisplayOrientation(token, orientation); return NO_ERROR; } void Composer::setDisplayViewport(const sp<IBinder>& token, const Rect& viewport) { Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); s.viewport = viewport; s.what |= DisplayState::eViewportChanged; } void Composer::setDisplayFrame(const sp<IBinder>& token, const Rect& frame) { Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); s.frame = frame; s.what |= DisplayState::eFrameChanged; } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- SurfaceComposerClient::SurfaceComposerClient() SurfaceComposerClient::SurfaceComposerClient() Loading Loading @@ -520,19 +501,12 @@ void SurfaceComposerClient::setDisplayLayerStack(const sp<IBinder>& token, Composer::getInstance().setDisplayLayerStack(token, layerStack); Composer::getInstance().setDisplayLayerStack(token, layerStack); } } void SurfaceComposerClient::setDisplayOrientation(const sp<IBinder>& token, void SurfaceComposerClient::setDisplayProjection(const sp<IBinder>& token, uint32_t orientation) { uint32_t orientation, Composer::getInstance().setDisplayOrientation(token, orientation); const Rect& layerStackRect, } const Rect& displayRect) { Composer::getInstance().setDisplayProjection(token, orientation, void SurfaceComposerClient::setDisplayViewport(const sp<IBinder>& token, layerStackRect, displayRect); const Rect& viewport) { Composer::getInstance().setDisplayViewport(token, viewport); } void SurfaceComposerClient::setDisplayFrame(const sp<IBinder>& token, const Rect& frame) { Composer::getInstance().setDisplayFrame(token, frame); } } // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading
services/surfaceflinger/DisplayDevice.cpp +5 −16 Original line number Original line Diff line number Diff line Loading @@ -150,7 +150,7 @@ void DisplayDevice::init(EGLConfig config) mHwcDisplayId = mFlinger->allocateHwcDisplayId(mType); mHwcDisplayId = mFlinger->allocateHwcDisplayId(mType); // initialize the display orientation transform. // initialize the display orientation transform. DisplayDevice::setOrientation(DisplayState::eOrientationDefault); setProjection(DisplayState::eOrientationDefault, mViewport, mFrame); } } uint32_t DisplayDevice::getPageFlipCount() const { uint32_t DisplayDevice::getPageFlipCount() const { Loading Loading @@ -298,24 +298,13 @@ status_t DisplayDevice::orientationToTransfrom( return NO_ERROR; return NO_ERROR; } } void DisplayDevice::setOrientation(int orientation) { void DisplayDevice::setProjection(int orientation, const Rect& viewport, const Rect& frame) { mOrientation = orientation; mOrientation = orientation; updateGeometryTransform(); } void DisplayDevice::setViewport(const Rect& viewport) { if (viewport.isValid()) { mViewport = viewport; mViewport = viewport; updateGeometryTransform(); } } void DisplayDevice::setFrame(const Rect& frame) { if (frame.isValid()) { mFrame = frame; mFrame = frame; updateGeometryTransform(); updateGeometryTransform(); } } } void DisplayDevice::updateGeometryTransform() { void DisplayDevice::updateGeometryTransform() { int w = mDisplayWidth; int w = mDisplayWidth; Loading
services/surfaceflinger/DisplayDevice.h +1 −3 Original line number Original line Diff line number Diff line Loading @@ -94,9 +94,7 @@ public: Region getDirtyRegion(bool repaintEverything) const; Region getDirtyRegion(bool repaintEverything) const; void setLayerStack(uint32_t stack); void setLayerStack(uint32_t stack); void setOrientation(int orientation); void setProjection(int orientation, const Rect& viewport, const Rect& frame); void setViewport(const Rect& viewport); void setFrame(const Rect& frame); int getOrientation() const { return mOrientation; } int getOrientation() const { return mOrientation; } const Transform& getTransform() const { return mGlobalTransform; } const Transform& getTransform() const { return mGlobalTransform; } Loading