Loading services/surfaceflinger/BufferLayer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ std::optional<compositionengine::LayerFE::LayerSettings> BufferLayer::prepareCli * of a camera where the buffer remains in native orientation, * we want the pixels to always be upright. */ auto p = mDrawingParent; sp<Layer> p = mDrawingParent.promote(); if (p != nullptr) { const auto parentTransform = p->getTransform(); tr = tr * inverseOrientation(parentTransform.getOrientation()); Loading services/surfaceflinger/BufferStateLayer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -937,7 +937,7 @@ void BufferStateLayer::tracePendingBufferCount(int32_t pendingBuffers) { * how to go from screen space back to window space. */ ui::Transform BufferStateLayer::getInputTransform() const { auto parent = mDrawingParent; sp<Layer> parent = mDrawingParent.promote(); if (parent == nullptr) { return ui::Transform(); } Loading services/surfaceflinger/Layer.cpp +33 −44 Original line number Diff line number Diff line Loading @@ -179,23 +179,9 @@ Layer::~Layer() { if (mDrawingState.sidebandStream != nullptr) { mFlinger->mTunnelModeEnabledReporter->decrementTunnelModeCount(); } if (mHadClonedChild) { mFlinger->mNumClones--; } for (auto const& child : mCurrentChildren) { if (child->mCurrentParent == this) child->mCurrentParent = nullptr; if (child->mDrawingParent == this) { child->mDrawingParent = nullptr; } } for (auto const& child : mDrawingChildren) { if (child->mCurrentParent == this) child->mCurrentParent = nullptr; if (child->mDrawingParent == this) { child->mDrawingParent = nullptr; } } } LayerCreationArgs::LayerCreationArgs(SurfaceFlinger* flinger, sp<Client> client, std::string name, Loading Loading @@ -252,7 +238,7 @@ void Layer::removeFromCurrentState() { } sp<Layer> Layer::getRootLayer() { auto parent = getParent(); sp<Layer> parent = getParent(); if (parent == nullptr) { return this; } Loading Loading @@ -677,7 +663,7 @@ bool Layer::isSecure() const { return true; } const auto p = mDrawingParent; const auto p = mDrawingParent.promote(); return (p != nullptr) ? p->isSecure() : false; } Loading Loading @@ -860,7 +846,7 @@ bool Layer::isTrustedOverlay() const { if (getDrawingState().isTrustedOverlay) { return true; } const auto p = mDrawingParent; const auto& p = mDrawingParent.promote(); return (p != nullptr) && p->isTrustedOverlay(); } Loading Loading @@ -1040,7 +1026,7 @@ int32_t Layer::getFrameRateSelectionPriority() const { return mDrawingState.frameRateSelectionPriority; } // If not, search whether its parents have it set. auto parent = getParent(); sp<Layer> parent = getParent(); if (parent != nullptr) { return parent->getFrameRateSelectionPriority(); } Loading @@ -1053,11 +1039,10 @@ bool Layer::isLayerFocusedBasedOnPriority(int32_t priority) { }; ui::LayerStack Layer::getLayerStack() const { auto p = mDrawingParent; if (p == nullptr) { return getDrawingState().layerStack; if (const auto parent = mDrawingParent.promote()) { return parent->getLayerStack(); } return mDrawingParent->getLayerStack(); return getDrawingState().layerStack; } bool Layer::setShadowRadius(float shadowRadius) { Loading Loading @@ -1102,7 +1087,7 @@ StretchEffect Layer::getStretchEffect() const { return mDrawingState.stretchEffect; } auto parent = mDrawingParent; sp<Layer> parent = getParent(); if (parent != nullptr) { auto effect = parent->getStretchEffect(); if (effect.hasEffect()) { Loading Loading @@ -1317,7 +1302,7 @@ Layer::FrameRate Layer::getFrameRateForLayerTree() const { bool Layer::isHiddenByPolicy() const { const State& s(mDrawingState); auto parent = mDrawingParent; const auto& parent = mDrawingParent.promote(); if (parent != nullptr && parent->isHiddenByPolicy()) { return true; } Loading Loading @@ -1364,7 +1349,7 @@ LayerDebugInfo Layer::getLayerDebugInfo(const DisplayDevice* display) const { LayerDebugInfo info; const State& ds = getDrawingState(); info.mName = getName(); auto parent = mDrawingParent; sp<Layer> parent = mDrawingParent.promote(); info.mParentName = parent ? parent->getName() : "none"s; info.mType = getType(); info.mTransparentRegion = ds.activeTransparentRegion_legacy; Loading Loading @@ -1596,7 +1581,7 @@ ssize_t Layer::removeChild(const sp<Layer>& layer) { void Layer::setChildrenDrawingParent(const sp<Layer>& newParent) { for (const sp<Layer>& child : mDrawingChildren) { child->mDrawingParent = newParent.get(); child->mDrawingParent = newParent; child->computeBounds(newParent->mBounds, newParent->mEffectiveTransform, newParent->mEffectiveShadowRadius); } Loading @@ -1616,7 +1601,7 @@ bool Layer::reparent(const sp<IBinder>& newParentHandle) { } } auto parent = getParent(); sp<Layer> parent = getParent(); if (parent != nullptr) { parent->removeChild(this); } Loading Loading @@ -1651,7 +1636,7 @@ bool Layer::setColorTransform(const mat4& matrix) { mat4 Layer::getColorTransform() const { mat4 colorTransform = mat4(getDrawingState().colorTransform); if (auto parent = mDrawingParent; parent != nullptr) { if (sp<Layer> parent = mDrawingParent.promote(); parent != nullptr) { colorTransform = parent->getColorTransform() * colorTransform; } return colorTransform; Loading @@ -1659,7 +1644,7 @@ mat4 Layer::getColorTransform() const { bool Layer::hasColorTransform() const { bool hasColorTransform = getDrawingState().hasColorTransform; if (auto parent = mDrawingParent; parent != nullptr) { if (sp<Layer> parent = mDrawingParent.promote(); parent != nullptr) { hasColorTransform = hasColorTransform || parent->hasColorTransform(); } return hasColorTransform; Loading @@ -1673,7 +1658,7 @@ bool Layer::isLegacyDataSpace() const { } void Layer::setParent(const sp<Layer>& layer) { mCurrentParent = layer.get(); mCurrentParent = layer; } int32_t Layer::getZ(LayerVector::StateSet) const { Loading Loading @@ -1877,7 +1862,7 @@ ui::Transform Layer::getTransform() const { } half Layer::getAlpha() const { auto p = mDrawingParent; const auto& p = mDrawingParent.promote(); half parentAlpha = (p != nullptr) ? p->getAlpha() : 1.0_hf; return parentAlpha * getDrawingState().color.a; Loading @@ -1888,7 +1873,7 @@ ui::Transform::RotationFlags Layer::getFixedTransformHint() const { if (fixedTransformHint != ui::Transform::ROT_INVALID) { return fixedTransformHint; } auto p = mCurrentParent; const auto& p = mCurrentParent.promote(); if (!p) return fixedTransformHint; return p->getFixedTransformHint(); } Loading @@ -1899,7 +1884,7 @@ half4 Layer::getColor() const { } int32_t Layer::getBackgroundBlurRadius() const { auto p = mDrawingParent; const auto& p = mDrawingParent.promote(); half parentAlpha = (p != nullptr) ? p->getAlpha() : 1.0_hf; return parentAlpha * getDrawingState().backgroundBlurRadius; Loading @@ -1917,8 +1902,9 @@ const std::vector<BlurRegion> Layer::getBlurRegions() const { Layer::RoundedCornerState Layer::getRoundedCornerState() const { // Get parent settings RoundedCornerState parentSettings; if (mDrawingParent != nullptr) { parentSettings = mDrawingParent->getRoundedCornerState(); const auto& parent = mDrawingParent.promote(); if (parent != nullptr) { parentSettings = parent->getRoundedCornerState(); if (parentSettings.radius > 0) { ui::Transform t = getActiveTransform(getDrawingState()); t = t.inverse(); Loading Loading @@ -2134,7 +2120,7 @@ void Layer::writeToProtoCommonState(LayerProto* layerInfo, LayerVector::StateSet LayerProtoHelper::writeToProtoDeprecated(requestedTransform, layerInfo->mutable_requested_transform()); auto parent = useDrawing ? mDrawingParent : mCurrentParent; auto parent = useDrawing ? mDrawingParent.promote() : mCurrentParent.promote(); if (parent != nullptr) { layerInfo->set_parent(parent->sequence); } else { Loading Loading @@ -2281,9 +2267,9 @@ void Layer::fillInputFrameInfo(WindowInfo& info, const ui::Transform& displayTra } void Layer::fillTouchOcclusionMode(WindowInfo& info) { Layer* p = this; sp<Layer> p = this; while (p != nullptr && !p->hasInputInfo()) { p = p->mDrawingParent; p = p->mDrawingParent.promote(); } if (p != nullptr) { info.touchOcclusionMode = p->mDrawingState.inputInfo.touchOcclusionMode; Loading @@ -2295,8 +2281,9 @@ gui::DropInputMode Layer::getDropInputMode() const { if (mode == gui::DropInputMode::ALL) { return mode; } if (mDrawingParent) { gui::DropInputMode parentMode = mDrawingParent->getDropInputMode(); sp<Layer> parent = mDrawingParent.promote(); if (parent) { gui::DropInputMode parentMode = parent->getDropInputMode(); if (parentMode != gui::DropInputMode::NONE) { return parentMode; } Loading @@ -2323,7 +2310,8 @@ void Layer::handleDropInputMode(gui::WindowInfo& info) const { } // Check if the parent has set an alpha on the layer if (mDrawingParent && mDrawingParent->getAlpha() != 1.0_hf) { sp<Layer> parent = mDrawingParent.promote(); if (parent && parent->getAlpha() != 1.0_hf) { info.inputFeatures |= WindowInfo::Feature::DROP_INPUT; ALOGV("Dropping input for %s as requested by policy because alpha=%f", getDebugName(), static_cast<float>(getAlpha())); Loading Loading @@ -2421,10 +2409,10 @@ sp<Layer> Layer::getClonedRoot() { if (mClonedChild != nullptr) { return this; } if (mDrawingParent == nullptr) { if (mDrawingParent == nullptr || mDrawingParent.promote() == nullptr) { return nullptr; } return mDrawingParent->getClonedRoot(); return mDrawingParent.promote()->getClonedRoot(); } bool Layer::hasInputInfo() const { Loading Loading @@ -2611,7 +2599,8 @@ bool Layer::isInternalDisplayOverlay() const { return true; } return mDrawingParent && mDrawingParent->isInternalDisplayOverlay(); sp<Layer> parent = mDrawingParent.promote(); return parent && parent->isInternalDisplayOverlay(); } void Layer::setClonedChild(const sp<Layer>& clonedChild) { Loading services/surfaceflinger/Layer.h +3 −3 Original line number Diff line number Diff line Loading @@ -796,12 +796,12 @@ public: // Returns index if removed, or negative value otherwise // for symmetry with Vector::remove ssize_t removeChild(const sp<Layer>& layer); sp<Layer> getParent() const { return mCurrentParent.promote(); } // Should be called with the surfaceflinger statelock held bool isAtRoot() const { return mIsAtRoot; } void setIsAtRoot(bool isAtRoot) { mIsAtRoot = isAtRoot; } Layer* getParent() const { return mCurrentParent; } bool hasParent() const { return getParent() != nullptr; } Rect getScreenBounds(bool reduceTransparentRegion = true) const; bool setChildLayer(const sp<Layer>& childLayer, int32_t z); Loading Loading @@ -1008,8 +1008,8 @@ protected: LayerVector mCurrentChildren{LayerVector::StateSet::Current}; LayerVector mDrawingChildren{LayerVector::StateSet::Drawing}; Layer* mCurrentParent = nullptr; Layer* mDrawingParent = nullptr; wp<Layer> mCurrentParent; wp<Layer> mDrawingParent; // Window types from WindowManager.LayoutParams const gui::WindowInfo::Type mWindowType; Loading services/surfaceflinger/SurfaceFlinger.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -3381,7 +3381,6 @@ status_t SurfaceFlinger::addClientLayer(const sp<Client>& client, const sp<IBind states.add(composerState); lbc->updateTransformHint(mActiveDisplayTransformHint); if (outTransformHint) { *outTransformHint = mActiveDisplayTransformHint; } Loading Loading @@ -3922,7 +3921,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(const FrameTimelineInfo& frameTime } if (what & layer_state_t::eLayerChanged) { // NOTE: index needs to be calculated before we update the state auto p = layer->getParent(); const auto& p = layer->getParent(); if (p == nullptr) { ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer); if (layer->setLayer(s.z) && idx >= 0) { Loading @@ -3940,7 +3939,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(const FrameTimelineInfo& frameTime } if (what & layer_state_t::eRelativeLayerChanged) { // NOTE: index needs to be calculated before we update the state auto p = layer->getParent(); const auto& p = layer->getParent(); const auto& relativeHandle = s.relativeLayerSurfaceControl ? s.relativeLayerSurfaceControl->getHandle() : nullptr; if (p == nullptr) { Loading Loading @@ -6078,7 +6077,7 @@ status_t SurfaceFlinger::captureLayers(const LayerCaptureArgs& args, return; } auto p = layer; sp<Layer> p = layer; while (p != nullptr) { if (excludeLayers.count(p) != 0) { return; Loading Loading
services/surfaceflinger/BufferLayer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ std::optional<compositionengine::LayerFE::LayerSettings> BufferLayer::prepareCli * of a camera where the buffer remains in native orientation, * we want the pixels to always be upright. */ auto p = mDrawingParent; sp<Layer> p = mDrawingParent.promote(); if (p != nullptr) { const auto parentTransform = p->getTransform(); tr = tr * inverseOrientation(parentTransform.getOrientation()); Loading
services/surfaceflinger/BufferStateLayer.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -937,7 +937,7 @@ void BufferStateLayer::tracePendingBufferCount(int32_t pendingBuffers) { * how to go from screen space back to window space. */ ui::Transform BufferStateLayer::getInputTransform() const { auto parent = mDrawingParent; sp<Layer> parent = mDrawingParent.promote(); if (parent == nullptr) { return ui::Transform(); } Loading
services/surfaceflinger/Layer.cpp +33 −44 Original line number Diff line number Diff line Loading @@ -179,23 +179,9 @@ Layer::~Layer() { if (mDrawingState.sidebandStream != nullptr) { mFlinger->mTunnelModeEnabledReporter->decrementTunnelModeCount(); } if (mHadClonedChild) { mFlinger->mNumClones--; } for (auto const& child : mCurrentChildren) { if (child->mCurrentParent == this) child->mCurrentParent = nullptr; if (child->mDrawingParent == this) { child->mDrawingParent = nullptr; } } for (auto const& child : mDrawingChildren) { if (child->mCurrentParent == this) child->mCurrentParent = nullptr; if (child->mDrawingParent == this) { child->mDrawingParent = nullptr; } } } LayerCreationArgs::LayerCreationArgs(SurfaceFlinger* flinger, sp<Client> client, std::string name, Loading Loading @@ -252,7 +238,7 @@ void Layer::removeFromCurrentState() { } sp<Layer> Layer::getRootLayer() { auto parent = getParent(); sp<Layer> parent = getParent(); if (parent == nullptr) { return this; } Loading Loading @@ -677,7 +663,7 @@ bool Layer::isSecure() const { return true; } const auto p = mDrawingParent; const auto p = mDrawingParent.promote(); return (p != nullptr) ? p->isSecure() : false; } Loading Loading @@ -860,7 +846,7 @@ bool Layer::isTrustedOverlay() const { if (getDrawingState().isTrustedOverlay) { return true; } const auto p = mDrawingParent; const auto& p = mDrawingParent.promote(); return (p != nullptr) && p->isTrustedOverlay(); } Loading Loading @@ -1040,7 +1026,7 @@ int32_t Layer::getFrameRateSelectionPriority() const { return mDrawingState.frameRateSelectionPriority; } // If not, search whether its parents have it set. auto parent = getParent(); sp<Layer> parent = getParent(); if (parent != nullptr) { return parent->getFrameRateSelectionPriority(); } Loading @@ -1053,11 +1039,10 @@ bool Layer::isLayerFocusedBasedOnPriority(int32_t priority) { }; ui::LayerStack Layer::getLayerStack() const { auto p = mDrawingParent; if (p == nullptr) { return getDrawingState().layerStack; if (const auto parent = mDrawingParent.promote()) { return parent->getLayerStack(); } return mDrawingParent->getLayerStack(); return getDrawingState().layerStack; } bool Layer::setShadowRadius(float shadowRadius) { Loading Loading @@ -1102,7 +1087,7 @@ StretchEffect Layer::getStretchEffect() const { return mDrawingState.stretchEffect; } auto parent = mDrawingParent; sp<Layer> parent = getParent(); if (parent != nullptr) { auto effect = parent->getStretchEffect(); if (effect.hasEffect()) { Loading Loading @@ -1317,7 +1302,7 @@ Layer::FrameRate Layer::getFrameRateForLayerTree() const { bool Layer::isHiddenByPolicy() const { const State& s(mDrawingState); auto parent = mDrawingParent; const auto& parent = mDrawingParent.promote(); if (parent != nullptr && parent->isHiddenByPolicy()) { return true; } Loading Loading @@ -1364,7 +1349,7 @@ LayerDebugInfo Layer::getLayerDebugInfo(const DisplayDevice* display) const { LayerDebugInfo info; const State& ds = getDrawingState(); info.mName = getName(); auto parent = mDrawingParent; sp<Layer> parent = mDrawingParent.promote(); info.mParentName = parent ? parent->getName() : "none"s; info.mType = getType(); info.mTransparentRegion = ds.activeTransparentRegion_legacy; Loading Loading @@ -1596,7 +1581,7 @@ ssize_t Layer::removeChild(const sp<Layer>& layer) { void Layer::setChildrenDrawingParent(const sp<Layer>& newParent) { for (const sp<Layer>& child : mDrawingChildren) { child->mDrawingParent = newParent.get(); child->mDrawingParent = newParent; child->computeBounds(newParent->mBounds, newParent->mEffectiveTransform, newParent->mEffectiveShadowRadius); } Loading @@ -1616,7 +1601,7 @@ bool Layer::reparent(const sp<IBinder>& newParentHandle) { } } auto parent = getParent(); sp<Layer> parent = getParent(); if (parent != nullptr) { parent->removeChild(this); } Loading Loading @@ -1651,7 +1636,7 @@ bool Layer::setColorTransform(const mat4& matrix) { mat4 Layer::getColorTransform() const { mat4 colorTransform = mat4(getDrawingState().colorTransform); if (auto parent = mDrawingParent; parent != nullptr) { if (sp<Layer> parent = mDrawingParent.promote(); parent != nullptr) { colorTransform = parent->getColorTransform() * colorTransform; } return colorTransform; Loading @@ -1659,7 +1644,7 @@ mat4 Layer::getColorTransform() const { bool Layer::hasColorTransform() const { bool hasColorTransform = getDrawingState().hasColorTransform; if (auto parent = mDrawingParent; parent != nullptr) { if (sp<Layer> parent = mDrawingParent.promote(); parent != nullptr) { hasColorTransform = hasColorTransform || parent->hasColorTransform(); } return hasColorTransform; Loading @@ -1673,7 +1658,7 @@ bool Layer::isLegacyDataSpace() const { } void Layer::setParent(const sp<Layer>& layer) { mCurrentParent = layer.get(); mCurrentParent = layer; } int32_t Layer::getZ(LayerVector::StateSet) const { Loading Loading @@ -1877,7 +1862,7 @@ ui::Transform Layer::getTransform() const { } half Layer::getAlpha() const { auto p = mDrawingParent; const auto& p = mDrawingParent.promote(); half parentAlpha = (p != nullptr) ? p->getAlpha() : 1.0_hf; return parentAlpha * getDrawingState().color.a; Loading @@ -1888,7 +1873,7 @@ ui::Transform::RotationFlags Layer::getFixedTransformHint() const { if (fixedTransformHint != ui::Transform::ROT_INVALID) { return fixedTransformHint; } auto p = mCurrentParent; const auto& p = mCurrentParent.promote(); if (!p) return fixedTransformHint; return p->getFixedTransformHint(); } Loading @@ -1899,7 +1884,7 @@ half4 Layer::getColor() const { } int32_t Layer::getBackgroundBlurRadius() const { auto p = mDrawingParent; const auto& p = mDrawingParent.promote(); half parentAlpha = (p != nullptr) ? p->getAlpha() : 1.0_hf; return parentAlpha * getDrawingState().backgroundBlurRadius; Loading @@ -1917,8 +1902,9 @@ const std::vector<BlurRegion> Layer::getBlurRegions() const { Layer::RoundedCornerState Layer::getRoundedCornerState() const { // Get parent settings RoundedCornerState parentSettings; if (mDrawingParent != nullptr) { parentSettings = mDrawingParent->getRoundedCornerState(); const auto& parent = mDrawingParent.promote(); if (parent != nullptr) { parentSettings = parent->getRoundedCornerState(); if (parentSettings.radius > 0) { ui::Transform t = getActiveTransform(getDrawingState()); t = t.inverse(); Loading Loading @@ -2134,7 +2120,7 @@ void Layer::writeToProtoCommonState(LayerProto* layerInfo, LayerVector::StateSet LayerProtoHelper::writeToProtoDeprecated(requestedTransform, layerInfo->mutable_requested_transform()); auto parent = useDrawing ? mDrawingParent : mCurrentParent; auto parent = useDrawing ? mDrawingParent.promote() : mCurrentParent.promote(); if (parent != nullptr) { layerInfo->set_parent(parent->sequence); } else { Loading Loading @@ -2281,9 +2267,9 @@ void Layer::fillInputFrameInfo(WindowInfo& info, const ui::Transform& displayTra } void Layer::fillTouchOcclusionMode(WindowInfo& info) { Layer* p = this; sp<Layer> p = this; while (p != nullptr && !p->hasInputInfo()) { p = p->mDrawingParent; p = p->mDrawingParent.promote(); } if (p != nullptr) { info.touchOcclusionMode = p->mDrawingState.inputInfo.touchOcclusionMode; Loading @@ -2295,8 +2281,9 @@ gui::DropInputMode Layer::getDropInputMode() const { if (mode == gui::DropInputMode::ALL) { return mode; } if (mDrawingParent) { gui::DropInputMode parentMode = mDrawingParent->getDropInputMode(); sp<Layer> parent = mDrawingParent.promote(); if (parent) { gui::DropInputMode parentMode = parent->getDropInputMode(); if (parentMode != gui::DropInputMode::NONE) { return parentMode; } Loading @@ -2323,7 +2310,8 @@ void Layer::handleDropInputMode(gui::WindowInfo& info) const { } // Check if the parent has set an alpha on the layer if (mDrawingParent && mDrawingParent->getAlpha() != 1.0_hf) { sp<Layer> parent = mDrawingParent.promote(); if (parent && parent->getAlpha() != 1.0_hf) { info.inputFeatures |= WindowInfo::Feature::DROP_INPUT; ALOGV("Dropping input for %s as requested by policy because alpha=%f", getDebugName(), static_cast<float>(getAlpha())); Loading Loading @@ -2421,10 +2409,10 @@ sp<Layer> Layer::getClonedRoot() { if (mClonedChild != nullptr) { return this; } if (mDrawingParent == nullptr) { if (mDrawingParent == nullptr || mDrawingParent.promote() == nullptr) { return nullptr; } return mDrawingParent->getClonedRoot(); return mDrawingParent.promote()->getClonedRoot(); } bool Layer::hasInputInfo() const { Loading Loading @@ -2611,7 +2599,8 @@ bool Layer::isInternalDisplayOverlay() const { return true; } return mDrawingParent && mDrawingParent->isInternalDisplayOverlay(); sp<Layer> parent = mDrawingParent.promote(); return parent && parent->isInternalDisplayOverlay(); } void Layer::setClonedChild(const sp<Layer>& clonedChild) { Loading
services/surfaceflinger/Layer.h +3 −3 Original line number Diff line number Diff line Loading @@ -796,12 +796,12 @@ public: // Returns index if removed, or negative value otherwise // for symmetry with Vector::remove ssize_t removeChild(const sp<Layer>& layer); sp<Layer> getParent() const { return mCurrentParent.promote(); } // Should be called with the surfaceflinger statelock held bool isAtRoot() const { return mIsAtRoot; } void setIsAtRoot(bool isAtRoot) { mIsAtRoot = isAtRoot; } Layer* getParent() const { return mCurrentParent; } bool hasParent() const { return getParent() != nullptr; } Rect getScreenBounds(bool reduceTransparentRegion = true) const; bool setChildLayer(const sp<Layer>& childLayer, int32_t z); Loading Loading @@ -1008,8 +1008,8 @@ protected: LayerVector mCurrentChildren{LayerVector::StateSet::Current}; LayerVector mDrawingChildren{LayerVector::StateSet::Drawing}; Layer* mCurrentParent = nullptr; Layer* mDrawingParent = nullptr; wp<Layer> mCurrentParent; wp<Layer> mDrawingParent; // Window types from WindowManager.LayoutParams const gui::WindowInfo::Type mWindowType; Loading
services/surfaceflinger/SurfaceFlinger.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -3381,7 +3381,6 @@ status_t SurfaceFlinger::addClientLayer(const sp<Client>& client, const sp<IBind states.add(composerState); lbc->updateTransformHint(mActiveDisplayTransformHint); if (outTransformHint) { *outTransformHint = mActiveDisplayTransformHint; } Loading Loading @@ -3922,7 +3921,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(const FrameTimelineInfo& frameTime } if (what & layer_state_t::eLayerChanged) { // NOTE: index needs to be calculated before we update the state auto p = layer->getParent(); const auto& p = layer->getParent(); if (p == nullptr) { ssize_t idx = mCurrentState.layersSortedByZ.indexOf(layer); if (layer->setLayer(s.z) && idx >= 0) { Loading @@ -3940,7 +3939,7 @@ uint32_t SurfaceFlinger::setClientStateLocked(const FrameTimelineInfo& frameTime } if (what & layer_state_t::eRelativeLayerChanged) { // NOTE: index needs to be calculated before we update the state auto p = layer->getParent(); const auto& p = layer->getParent(); const auto& relativeHandle = s.relativeLayerSurfaceControl ? s.relativeLayerSurfaceControl->getHandle() : nullptr; if (p == nullptr) { Loading Loading @@ -6078,7 +6077,7 @@ status_t SurfaceFlinger::captureLayers(const LayerCaptureArgs& args, return; } auto p = layer; sp<Layer> p = layer; while (p != nullptr) { if (excludeLayers.count(p) != 0) { return; Loading