Loading cmds/surfacereplayer/replayer/Replayer.cpp +6 −8 Original line number Diff line number Diff line Loading @@ -584,9 +584,7 @@ void Replayer::setDeferredTransaction(SurfaceComposerClient::Transaction& t, return; } auto handle = mLayers[dtc.layer_id()]->getHandle(); t.deferTransactionUntil_legacy(mLayers[id], handle, dtc.frame_number()); t.deferTransactionUntil_legacy(mLayers[id], mLayers[dtc.layer_id()], dtc.frame_number()); } void Replayer::setDisplaySurface(SurfaceComposerClient::Transaction& t, Loading Loading @@ -706,11 +704,11 @@ status_t Replayer::loadSurfaceComposerClient() { void Replayer::setReparentChange(SurfaceComposerClient::Transaction& t, layer_id id, const ReparentChange& c) { sp<IBinder> newParentHandle = nullptr; sp<SurfaceControl> newSurfaceControl = nullptr; if (mLayers.count(c.parent_id()) != 0 && mLayers[c.parent_id()] != nullptr) { newParentHandle = mLayers[c.parent_id()]->getHandle(); newSurfaceControl = mLayers[c.parent_id()]; } t.reparent(mLayers[id], newParentHandle); t.reparent(mLayers[id], newSurfaceControl); } void Replayer::setRelativeParentChange(SurfaceComposerClient::Transaction& t, Loading @@ -719,7 +717,7 @@ void Replayer::setRelativeParentChange(SurfaceComposerClient::Transaction& t, ALOGE("Layer %d not found in set relative parent transaction", c.relative_parent_id()); return; } t.setRelativeLayer(mLayers[id], mLayers[c.relative_parent_id()]->getHandle(), c.z()); t.setRelativeLayer(mLayers[id], mLayers[c.relative_parent_id()], c.z()); } void Replayer::setDetachChildrenChange(SurfaceComposerClient::Transaction& t, Loading @@ -733,7 +731,7 @@ void Replayer::setReparentChildrenChange(SurfaceComposerClient::Transaction& t, ALOGE("Layer %d not found in reparent children transaction", c.parent_id()); return; } t.reparentChildren(mLayers[id], mLayers[c.parent_id()]->getHandle()); t.reparentChildren(mLayers[id], mLayers[c.parent_id()]); } void Replayer::setShadowRadiusChange(SurfaceComposerClient::Transaction& t, Loading libs/gui/LayerState.cpp +54 −14 Original line number Diff line number Diff line Loading @@ -18,16 +18,55 @@ #include <inttypes.h> #include <utils/Errors.h> #include <binder/Parcel.h> #include <gui/ISurfaceComposerClient.h> #include <gui/IGraphicBufferProducer.h> #include <gui/ISurfaceComposerClient.h> #include <gui/LayerState.h> #include <utils/Errors.h> #include <cmath> namespace android { layer_state_t::layer_state_t() : what(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), alpha(0), flags(0), mask(0), reserved(0), crop_legacy(Rect::INVALID_RECT), cornerRadius(0.0f), backgroundBlurRadius(0), barrierFrameNumber(0), overrideScalingMode(-1), transform(0), transformToDisplayInverse(false), crop(Rect::INVALID_RECT), orientedDisplaySpaceRect(Rect::INVALID_RECT), dataspace(ui::Dataspace::UNKNOWN), surfaceDamageRegion(), api(-1), colorTransform(mat4()), bgColorAlpha(0), bgColorDataspace(ui::Dataspace::UNKNOWN), colorSpaceAgnostic(false), shadowRadius(0.0f), frameRateSelectionPriority(-1), frameRate(0.0f), frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT), fixedTransformHint(ui::Transform::ROT_INVALID), frameNumber(0) { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; hdrMetadata.validTypes = 0; } status_t layer_state_t::write(Parcel& output) const { SAFE_PARCEL(output.writeStrongBinder, surface); Loading @@ -44,13 +83,13 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeUint32, mask); SAFE_PARCEL(matrix.write, output); SAFE_PARCEL(output.write, crop_legacy); SAFE_PARCEL(output.writeStrongBinder, barrierHandle_legacy); SAFE_PARCEL(output.writeStrongBinder, reparentHandle); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, barrierSurfaceControl_legacy); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, reparentSurfaceControl); SAFE_PARCEL(output.writeUint64, barrierFrameNumber); SAFE_PARCEL(output.writeInt32, overrideScalingMode); SAFE_PARCEL(output.writeStrongBinder, IInterface::asBinder(barrierGbp_legacy)); SAFE_PARCEL(output.writeStrongBinder, relativeLayerHandle); SAFE_PARCEL(output.writeStrongBinder, parentHandleForChild); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, relativeLayerSurfaceControl); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, parentSurfaceControlForChild); SAFE_PARCEL(output.writeFloat, color.r); SAFE_PARCEL(output.writeFloat, color.g); SAFE_PARCEL(output.writeFloat, color.b); Loading Loading @@ -135,8 +174,8 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(matrix.read, input); SAFE_PARCEL(input.read, crop_legacy); SAFE_PARCEL(input.readNullableStrongBinder, &barrierHandle_legacy); SAFE_PARCEL(input.readNullableStrongBinder, &reparentHandle); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &barrierSurfaceControl_legacy); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &reparentSurfaceControl); SAFE_PARCEL(input.readUint64, &barrierFrameNumber); SAFE_PARCEL(input.readInt32, &overrideScalingMode); Loading @@ -144,9 +183,10 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readNullableStrongBinder, &tmpBinder); barrierGbp_legacy = interface_cast<IGraphicBufferProducer>(tmpBinder); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &relativeLayerSurfaceControl); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &parentSurfaceControlForChild); float tmpFloat = 0; SAFE_PARCEL(input.readNullableStrongBinder, &relativeLayerHandle); SAFE_PARCEL(input.readNullableStrongBinder, &parentHandleForChild); SAFE_PARCEL(input.readFloat, &tmpFloat); color.r = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); Loading Loading @@ -342,7 +382,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eDeferTransaction_legacy) { what |= eDeferTransaction_legacy; barrierHandle_legacy = other.barrierHandle_legacy; barrierSurfaceControl_legacy = other.barrierSurfaceControl_legacy; barrierGbp_legacy = other.barrierGbp_legacy; barrierFrameNumber = other.barrierFrameNumber; } Loading @@ -352,7 +392,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eReparentChildren) { what |= eReparentChildren; reparentHandle = other.reparentHandle; reparentSurfaceControl = other.reparentSurfaceControl; } if (other.what & eDetachChildren) { what |= eDetachChildren; Loading @@ -361,11 +401,11 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eRelativeLayerChanged; what &= ~eLayerChanged; z = other.z; relativeLayerHandle = other.relativeLayerHandle; relativeLayerSurfaceControl = other.relativeLayerSurfaceControl; } if (other.what & eReparent) { what |= eReparent; parentHandleForChild = other.parentHandleForChild; parentSurfaceControlForChild = other.parentSurfaceControlForChild; } if (other.what & eDestroySurface) { what |= eDestroySurface; Loading libs/gui/SurfaceComposerClient.cpp +11 −13 Original line number Diff line number Diff line Loading @@ -875,8 +875,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setLayer return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setRelativeLayer(const sp<SurfaceControl>& sc, const sp<IBinder>& relativeTo, int32_t z) { SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setRelativeLayer( const sp<SurfaceControl>& sc, const sp<SurfaceControl>& relativeTo, int32_t z) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; Loading @@ -884,7 +884,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setRelat } s->what |= layer_state_t::eRelativeLayerChanged; s->what &= ~layer_state_t::eLayerChanged; s->relativeLayerHandle = relativeTo; s->relativeLayerSurfaceControl = relativeTo; s->z = z; registerSurfaceControlForCallback(sc); Loading Loading @@ -1028,8 +1028,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBackg } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<SurfaceControl>& sc, const sp<IBinder>& handle, SurfaceComposerClient::Transaction::deferTransactionUntil_legacy( const sp<SurfaceControl>& sc, const sp<SurfaceControl>& barrierSurfaceControl, uint64_t frameNumber) { layer_state_t* s = getLayerState(sc); if (!s) { Loading @@ -1037,7 +1037,7 @@ SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<Surfac return *this; } s->what |= layer_state_t::eDeferTransaction_legacy; s->barrierHandle_legacy = handle; s->barrierSurfaceControl_legacy = barrierSurfaceControl; s->barrierFrameNumber = frameNumber; registerSurfaceControlForCallback(sc); Loading @@ -1062,30 +1062,28 @@ SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<Surfac } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::reparentChildren( const sp<SurfaceControl>& sc, const sp<IBinder>& newParentHandle) { const sp<SurfaceControl>& sc, const sp<SurfaceControl>& newParent) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eReparentChildren; s->reparentHandle = newParentHandle; s->reparentSurfaceControl = newParent; registerSurfaceControlForCallback(sc); return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::reparent( const sp<SurfaceControl>& sc, const sp<IBinder>& newParentHandle) { const sp<SurfaceControl>& sc, const sp<SurfaceControl>& newParent) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eReparent; s->parentHandleForChild = newParentHandle; s->parentSurfaceControlForChild = newParent; registerSurfaceControlForCallback(sc); return *this; Loading libs/gui/SurfaceControl.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <android/native_window.h> #include <utils/Errors.h> #include <utils/KeyedVector.h> #include <utils/Log.h> #include <utils/threads.h> Loading libs/gui/include/gui/LayerState.h +6 −42 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include <gui/ISurfaceComposer.h> #include <gui/LayerMetadata.h> #include <gui/SurfaceControl.h> #include <math/vec3.h> #include <ui/GraphicTypes.h> #include <ui/Rect.h> Loading Loading @@ -128,44 +129,7 @@ struct layer_state_t { eFrameNumberChanged = 0x400'00000000, }; layer_state_t() : what(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), alpha(0), flags(0), mask(0), reserved(0), crop_legacy(Rect::INVALID_RECT), cornerRadius(0.0f), backgroundBlurRadius(0), barrierFrameNumber(0), overrideScalingMode(-1), transform(0), transformToDisplayInverse(false), crop(Rect::INVALID_RECT), orientedDisplaySpaceRect(Rect::INVALID_RECT), dataspace(ui::Dataspace::UNKNOWN), surfaceDamageRegion(), api(-1), colorTransform(mat4()), bgColorAlpha(0), bgColorDataspace(ui::Dataspace::UNKNOWN), colorSpaceAgnostic(false), shadowRadius(0.0f), frameRateSelectionPriority(-1), frameRate(0.0f), frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT), fixedTransformHint(ui::Transform::ROT_INVALID), frameNumber(0) { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; hdrMetadata.validTypes = 0; } layer_state_t(); void merge(const layer_state_t& other); status_t write(Parcel& output) const; Loading Loading @@ -196,16 +160,16 @@ struct layer_state_t { Rect crop_legacy; float cornerRadius; uint32_t backgroundBlurRadius; sp<IBinder> barrierHandle_legacy; sp<IBinder> reparentHandle; sp<SurfaceControl> barrierSurfaceControl_legacy; sp<SurfaceControl> reparentSurfaceControl; uint64_t barrierFrameNumber; int32_t overrideScalingMode; sp<IGraphicBufferProducer> barrierGbp_legacy; sp<IBinder> relativeLayerHandle; sp<SurfaceControl> relativeLayerSurfaceControl; sp<IBinder> parentHandleForChild; sp<SurfaceControl> parentSurfaceControlForChild; half3 color; Loading Loading
cmds/surfacereplayer/replayer/Replayer.cpp +6 −8 Original line number Diff line number Diff line Loading @@ -584,9 +584,7 @@ void Replayer::setDeferredTransaction(SurfaceComposerClient::Transaction& t, return; } auto handle = mLayers[dtc.layer_id()]->getHandle(); t.deferTransactionUntil_legacy(mLayers[id], handle, dtc.frame_number()); t.deferTransactionUntil_legacy(mLayers[id], mLayers[dtc.layer_id()], dtc.frame_number()); } void Replayer::setDisplaySurface(SurfaceComposerClient::Transaction& t, Loading Loading @@ -706,11 +704,11 @@ status_t Replayer::loadSurfaceComposerClient() { void Replayer::setReparentChange(SurfaceComposerClient::Transaction& t, layer_id id, const ReparentChange& c) { sp<IBinder> newParentHandle = nullptr; sp<SurfaceControl> newSurfaceControl = nullptr; if (mLayers.count(c.parent_id()) != 0 && mLayers[c.parent_id()] != nullptr) { newParentHandle = mLayers[c.parent_id()]->getHandle(); newSurfaceControl = mLayers[c.parent_id()]; } t.reparent(mLayers[id], newParentHandle); t.reparent(mLayers[id], newSurfaceControl); } void Replayer::setRelativeParentChange(SurfaceComposerClient::Transaction& t, Loading @@ -719,7 +717,7 @@ void Replayer::setRelativeParentChange(SurfaceComposerClient::Transaction& t, ALOGE("Layer %d not found in set relative parent transaction", c.relative_parent_id()); return; } t.setRelativeLayer(mLayers[id], mLayers[c.relative_parent_id()]->getHandle(), c.z()); t.setRelativeLayer(mLayers[id], mLayers[c.relative_parent_id()], c.z()); } void Replayer::setDetachChildrenChange(SurfaceComposerClient::Transaction& t, Loading @@ -733,7 +731,7 @@ void Replayer::setReparentChildrenChange(SurfaceComposerClient::Transaction& t, ALOGE("Layer %d not found in reparent children transaction", c.parent_id()); return; } t.reparentChildren(mLayers[id], mLayers[c.parent_id()]->getHandle()); t.reparentChildren(mLayers[id], mLayers[c.parent_id()]); } void Replayer::setShadowRadiusChange(SurfaceComposerClient::Transaction& t, Loading
libs/gui/LayerState.cpp +54 −14 Original line number Diff line number Diff line Loading @@ -18,16 +18,55 @@ #include <inttypes.h> #include <utils/Errors.h> #include <binder/Parcel.h> #include <gui/ISurfaceComposerClient.h> #include <gui/IGraphicBufferProducer.h> #include <gui/ISurfaceComposerClient.h> #include <gui/LayerState.h> #include <utils/Errors.h> #include <cmath> namespace android { layer_state_t::layer_state_t() : what(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), alpha(0), flags(0), mask(0), reserved(0), crop_legacy(Rect::INVALID_RECT), cornerRadius(0.0f), backgroundBlurRadius(0), barrierFrameNumber(0), overrideScalingMode(-1), transform(0), transformToDisplayInverse(false), crop(Rect::INVALID_RECT), orientedDisplaySpaceRect(Rect::INVALID_RECT), dataspace(ui::Dataspace::UNKNOWN), surfaceDamageRegion(), api(-1), colorTransform(mat4()), bgColorAlpha(0), bgColorDataspace(ui::Dataspace::UNKNOWN), colorSpaceAgnostic(false), shadowRadius(0.0f), frameRateSelectionPriority(-1), frameRate(0.0f), frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT), fixedTransformHint(ui::Transform::ROT_INVALID), frameNumber(0) { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; hdrMetadata.validTypes = 0; } status_t layer_state_t::write(Parcel& output) const { SAFE_PARCEL(output.writeStrongBinder, surface); Loading @@ -44,13 +83,13 @@ status_t layer_state_t::write(Parcel& output) const SAFE_PARCEL(output.writeUint32, mask); SAFE_PARCEL(matrix.write, output); SAFE_PARCEL(output.write, crop_legacy); SAFE_PARCEL(output.writeStrongBinder, barrierHandle_legacy); SAFE_PARCEL(output.writeStrongBinder, reparentHandle); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, barrierSurfaceControl_legacy); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, reparentSurfaceControl); SAFE_PARCEL(output.writeUint64, barrierFrameNumber); SAFE_PARCEL(output.writeInt32, overrideScalingMode); SAFE_PARCEL(output.writeStrongBinder, IInterface::asBinder(barrierGbp_legacy)); SAFE_PARCEL(output.writeStrongBinder, relativeLayerHandle); SAFE_PARCEL(output.writeStrongBinder, parentHandleForChild); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, relativeLayerSurfaceControl); SAFE_PARCEL(SurfaceControl::writeNullableToParcel, output, parentSurfaceControlForChild); SAFE_PARCEL(output.writeFloat, color.r); SAFE_PARCEL(output.writeFloat, color.g); SAFE_PARCEL(output.writeFloat, color.b); Loading Loading @@ -135,8 +174,8 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(matrix.read, input); SAFE_PARCEL(input.read, crop_legacy); SAFE_PARCEL(input.readNullableStrongBinder, &barrierHandle_legacy); SAFE_PARCEL(input.readNullableStrongBinder, &reparentHandle); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &barrierSurfaceControl_legacy); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &reparentSurfaceControl); SAFE_PARCEL(input.readUint64, &barrierFrameNumber); SAFE_PARCEL(input.readInt32, &overrideScalingMode); Loading @@ -144,9 +183,10 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readNullableStrongBinder, &tmpBinder); barrierGbp_legacy = interface_cast<IGraphicBufferProducer>(tmpBinder); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &relativeLayerSurfaceControl); SAFE_PARCEL(SurfaceControl::readNullableFromParcel, input, &parentSurfaceControlForChild); float tmpFloat = 0; SAFE_PARCEL(input.readNullableStrongBinder, &relativeLayerHandle); SAFE_PARCEL(input.readNullableStrongBinder, &parentHandleForChild); SAFE_PARCEL(input.readFloat, &tmpFloat); color.r = tmpFloat; SAFE_PARCEL(input.readFloat, &tmpFloat); Loading Loading @@ -342,7 +382,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eDeferTransaction_legacy) { what |= eDeferTransaction_legacy; barrierHandle_legacy = other.barrierHandle_legacy; barrierSurfaceControl_legacy = other.barrierSurfaceControl_legacy; barrierGbp_legacy = other.barrierGbp_legacy; barrierFrameNumber = other.barrierFrameNumber; } Loading @@ -352,7 +392,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eReparentChildren) { what |= eReparentChildren; reparentHandle = other.reparentHandle; reparentSurfaceControl = other.reparentSurfaceControl; } if (other.what & eDetachChildren) { what |= eDetachChildren; Loading @@ -361,11 +401,11 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eRelativeLayerChanged; what &= ~eLayerChanged; z = other.z; relativeLayerHandle = other.relativeLayerHandle; relativeLayerSurfaceControl = other.relativeLayerSurfaceControl; } if (other.what & eReparent) { what |= eReparent; parentHandleForChild = other.parentHandleForChild; parentSurfaceControlForChild = other.parentSurfaceControlForChild; } if (other.what & eDestroySurface) { what |= eDestroySurface; Loading
libs/gui/SurfaceComposerClient.cpp +11 −13 Original line number Diff line number Diff line Loading @@ -875,8 +875,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setLayer return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setRelativeLayer(const sp<SurfaceControl>& sc, const sp<IBinder>& relativeTo, int32_t z) { SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setRelativeLayer( const sp<SurfaceControl>& sc, const sp<SurfaceControl>& relativeTo, int32_t z) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; Loading @@ -884,7 +884,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setRelat } s->what |= layer_state_t::eRelativeLayerChanged; s->what &= ~layer_state_t::eLayerChanged; s->relativeLayerHandle = relativeTo; s->relativeLayerSurfaceControl = relativeTo; s->z = z; registerSurfaceControlForCallback(sc); Loading Loading @@ -1028,8 +1028,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBackg } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<SurfaceControl>& sc, const sp<IBinder>& handle, SurfaceComposerClient::Transaction::deferTransactionUntil_legacy( const sp<SurfaceControl>& sc, const sp<SurfaceControl>& barrierSurfaceControl, uint64_t frameNumber) { layer_state_t* s = getLayerState(sc); if (!s) { Loading @@ -1037,7 +1037,7 @@ SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<Surfac return *this; } s->what |= layer_state_t::eDeferTransaction_legacy; s->barrierHandle_legacy = handle; s->barrierSurfaceControl_legacy = barrierSurfaceControl; s->barrierFrameNumber = frameNumber; registerSurfaceControlForCallback(sc); Loading @@ -1062,30 +1062,28 @@ SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<Surfac } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::reparentChildren( const sp<SurfaceControl>& sc, const sp<IBinder>& newParentHandle) { const sp<SurfaceControl>& sc, const sp<SurfaceControl>& newParent) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eReparentChildren; s->reparentHandle = newParentHandle; s->reparentSurfaceControl = newParent; registerSurfaceControlForCallback(sc); return *this; } SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::reparent( const sp<SurfaceControl>& sc, const sp<IBinder>& newParentHandle) { const sp<SurfaceControl>& sc, const sp<SurfaceControl>& newParent) { layer_state_t* s = getLayerState(sc); if (!s) { mStatus = BAD_INDEX; return *this; } s->what |= layer_state_t::eReparent; s->parentHandleForChild = newParentHandle; s->parentSurfaceControlForChild = newParent; registerSurfaceControlForCallback(sc); return *this; Loading
libs/gui/SurfaceControl.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <android/native_window.h> #include <utils/Errors.h> #include <utils/KeyedVector.h> #include <utils/Log.h> #include <utils/threads.h> Loading
libs/gui/include/gui/LayerState.h +6 −42 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ #include <gui/ISurfaceComposer.h> #include <gui/LayerMetadata.h> #include <gui/SurfaceControl.h> #include <math/vec3.h> #include <ui/GraphicTypes.h> #include <ui/Rect.h> Loading Loading @@ -128,44 +129,7 @@ struct layer_state_t { eFrameNumberChanged = 0x400'00000000, }; layer_state_t() : what(0), x(0), y(0), z(0), w(0), h(0), layerStack(0), alpha(0), flags(0), mask(0), reserved(0), crop_legacy(Rect::INVALID_RECT), cornerRadius(0.0f), backgroundBlurRadius(0), barrierFrameNumber(0), overrideScalingMode(-1), transform(0), transformToDisplayInverse(false), crop(Rect::INVALID_RECT), orientedDisplaySpaceRect(Rect::INVALID_RECT), dataspace(ui::Dataspace::UNKNOWN), surfaceDamageRegion(), api(-1), colorTransform(mat4()), bgColorAlpha(0), bgColorDataspace(ui::Dataspace::UNKNOWN), colorSpaceAgnostic(false), shadowRadius(0.0f), frameRateSelectionPriority(-1), frameRate(0.0f), frameRateCompatibility(ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT), fixedTransformHint(ui::Transform::ROT_INVALID), frameNumber(0) { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; hdrMetadata.validTypes = 0; } layer_state_t(); void merge(const layer_state_t& other); status_t write(Parcel& output) const; Loading Loading @@ -196,16 +160,16 @@ struct layer_state_t { Rect crop_legacy; float cornerRadius; uint32_t backgroundBlurRadius; sp<IBinder> barrierHandle_legacy; sp<IBinder> reparentHandle; sp<SurfaceControl> barrierSurfaceControl_legacy; sp<SurfaceControl> reparentSurfaceControl; uint64_t barrierFrameNumber; int32_t overrideScalingMode; sp<IGraphicBufferProducer> barrierGbp_legacy; sp<IBinder> relativeLayerHandle; sp<SurfaceControl> relativeLayerSurfaceControl; sp<IBinder> parentHandleForChild; sp<SurfaceControl> parentSurfaceControlForChild; half3 color; Loading