diff options
author | 2019-10-28 16:35:48 -0700 | |
---|---|---|
committer | 2019-11-06 10:05:52 -0800 | |
commit | 1acd6961737cc32627d8298999878c2674328b6b (patch) | |
tree | ac658e008a96a4b6fb1ebfe053745831d1890838 /libs/gui/SurfaceControl.cpp | |
parent | ff98dc356204798ee6a9022fc26debbcf4248891 (diff) |
Pass back transformHint on Surface Creation
Bug: 141939598
Test: build, boot, SurfaceFlinger_test, libgui_test,
libsurfaceflinger_unittest
Change-Id: I35a77ac1399ad4248cb1c2357afb869de4c15170
Diffstat (limited to 'libs/gui/SurfaceControl.cpp')
-rw-r--r-- | libs/gui/SurfaceControl.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/libs/gui/SurfaceControl.cpp b/libs/gui/SurfaceControl.cpp index 071314f082..6292388ac3 100644 --- a/libs/gui/SurfaceControl.cpp +++ b/libs/gui/SurfaceControl.cpp @@ -45,20 +45,21 @@ namespace android { // SurfaceControl // ============================================================================ -SurfaceControl::SurfaceControl( - const sp<SurfaceComposerClient>& client, - const sp<IBinder>& handle, - const sp<IGraphicBufferProducer>& gbp, - bool owned) - : mClient(client), mHandle(handle), mGraphicBufferProducer(gbp), mOwned(owned) -{ -} +SurfaceControl::SurfaceControl(const sp<SurfaceComposerClient>& client, const sp<IBinder>& handle, + const sp<IGraphicBufferProducer>& gbp, bool owned, + uint32_t transform) + : mClient(client), + mHandle(handle), + mGraphicBufferProducer(gbp), + mOwned(owned), + mTransformHint(transform) {} SurfaceControl::SurfaceControl(const sp<SurfaceControl>& other) { mClient = other->mClient; mHandle = other->mHandle; mGraphicBufferProducer = other->mGraphicBufferProducer; mOwned = false; + mTransformHint = other->mTransformHint; } SurfaceControl::~SurfaceControl() @@ -171,11 +172,22 @@ sp<SurfaceComposerClient> SurfaceControl::getClient() const return mClient; } +uint32_t SurfaceControl::getTransformHint() const { + Mutex::Autolock _l(mLock); + return mTransformHint; +} + +void SurfaceControl::setTransformHint(uint32_t hint) { + Mutex::Autolock _l(mLock); + mTransformHint = hint; +} + void SurfaceControl::writeToParcel(Parcel* parcel) { parcel->writeStrongBinder(ISurfaceComposerClient::asBinder(mClient->getClient())); parcel->writeStrongBinder(mHandle); parcel->writeStrongBinder(IGraphicBufferProducer::asBinder(mGraphicBufferProducer)); + parcel->writeUint32(mTransformHint); } sp<SurfaceControl> SurfaceControl::readFromParcel(const Parcel* parcel) { @@ -189,10 +201,12 @@ sp<SurfaceControl> SurfaceControl::readFromParcel(const Parcel* parcel) { sp<IBinder> gbp; parcel->readNullableStrongBinder(&gbp); + uint32_t transformHint = parcel->readUint32(); // We aren't the original owner of the surface. return new SurfaceControl(new SurfaceComposerClient( - interface_cast<ISurfaceComposerClient>(client)), - handle.get(), interface_cast<IGraphicBufferProducer>(gbp), false /* owned */); + interface_cast<ISurfaceComposerClient>(client)), + handle.get(), interface_cast<IGraphicBufferProducer>(gbp), + false /* owned */, transformHint); } // ---------------------------------------------------------------------------- |