Loading services/surfaceflinger/Layer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,9 @@ Layer::~Layer() { if (mDrawingState.sidebandStream != nullptr) { mFlinger->mTunnelModeEnabledReporter->decrementTunnelModeCount(); } if (mHadClonedChild) { mFlinger->mNumClones--; } } LayerCreationArgs::LayerCreationArgs(SurfaceFlinger* flinger, sp<Client> client, std::string name, Loading Loading @@ -2536,6 +2539,12 @@ bool Layer::getPrimaryDisplayOnly() const { return parent == nullptr ? false : parent->getPrimaryDisplayOnly(); } void Layer::setClonedChild(const sp<Layer>& clonedChild) { mClonedChild = clonedChild; mHadClonedChild = true; mFlinger->mNumClones++; } // --------------------------------------------------------------------------- std::ostream& operator<<(std::ostream& stream, const Layer::FrameRate& rate) { Loading services/surfaceflinger/Layer.h +2 −0 Original line number Diff line number Diff line Loading @@ -863,6 +863,8 @@ public: // The layers in the cloned hierarchy will match the lifetime of the real layers. That is // if the real layer is destroyed, then the clone layer will also be destroyed. sp<Layer> mClonedChild; bool mHadClonedChild = false; void setClonedChild(const sp<Layer>& mClonedChild); mutable bool contentDirty{false}; Region surfaceDamageRegion; Loading services/surfaceflinger/SurfaceFlinger.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -3255,8 +3255,10 @@ void SurfaceFlinger::commitTransactionLocked() { } commitOffscreenLayers(); if (mNumClones > 0) { mDrawingState.traverse([&](Layer* layer) { layer->updateMirrorInfo(); }); } } void SurfaceFlinger::commitOffscreenLayers() { for (Layer* offscreenLayer : mOffscreenLayers) { Loading Loading @@ -3361,7 +3363,9 @@ bool SurfaceFlinger::handlePageFlip() { mBootStage = BootStage::BOOTANIMATION; } if (mNumClones > 0) { mDrawingState.traverse([&](Layer* layer) { layer->updateCloneBufferInfo(); }); } // Only continue with the refresh if there is actually new work to do return !mLayersWithQueuedFrames.empty() && newDataLatched; Loading Loading @@ -4246,7 +4250,7 @@ status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder> return result; } mirrorLayer->mClonedChild = mirrorFrom->createClone(); mirrorLayer->setClonedChild(mirrorFrom->createClone()); } *outLayerId = mirrorLayer->sequence; Loading services/surfaceflinger/SurfaceFlinger.h +3 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,9 @@ public: void removeHierarchyFromOffscreenLayers(Layer* layer); void removeFromOffscreenLayers(Layer* layer); // TODO: Remove atomic if move dtor to main thread CL lands std::atomic<uint32_t> mNumClones; TransactionCallbackInvoker& getTransactionCallbackInvoker() { return mTransactionCallbackInvoker; } Loading Loading
services/surfaceflinger/Layer.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,9 @@ Layer::~Layer() { if (mDrawingState.sidebandStream != nullptr) { mFlinger->mTunnelModeEnabledReporter->decrementTunnelModeCount(); } if (mHadClonedChild) { mFlinger->mNumClones--; } } LayerCreationArgs::LayerCreationArgs(SurfaceFlinger* flinger, sp<Client> client, std::string name, Loading Loading @@ -2536,6 +2539,12 @@ bool Layer::getPrimaryDisplayOnly() const { return parent == nullptr ? false : parent->getPrimaryDisplayOnly(); } void Layer::setClonedChild(const sp<Layer>& clonedChild) { mClonedChild = clonedChild; mHadClonedChild = true; mFlinger->mNumClones++; } // --------------------------------------------------------------------------- std::ostream& operator<<(std::ostream& stream, const Layer::FrameRate& rate) { Loading
services/surfaceflinger/Layer.h +2 −0 Original line number Diff line number Diff line Loading @@ -863,6 +863,8 @@ public: // The layers in the cloned hierarchy will match the lifetime of the real layers. That is // if the real layer is destroyed, then the clone layer will also be destroyed. sp<Layer> mClonedChild; bool mHadClonedChild = false; void setClonedChild(const sp<Layer>& mClonedChild); mutable bool contentDirty{false}; Region surfaceDamageRegion; Loading
services/surfaceflinger/SurfaceFlinger.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -3255,8 +3255,10 @@ void SurfaceFlinger::commitTransactionLocked() { } commitOffscreenLayers(); if (mNumClones > 0) { mDrawingState.traverse([&](Layer* layer) { layer->updateMirrorInfo(); }); } } void SurfaceFlinger::commitOffscreenLayers() { for (Layer* offscreenLayer : mOffscreenLayers) { Loading Loading @@ -3361,7 +3363,9 @@ bool SurfaceFlinger::handlePageFlip() { mBootStage = BootStage::BOOTANIMATION; } if (mNumClones > 0) { mDrawingState.traverse([&](Layer* layer) { layer->updateCloneBufferInfo(); }); } // Only continue with the refresh if there is actually new work to do return !mLayersWithQueuedFrames.empty() && newDataLatched; Loading Loading @@ -4246,7 +4250,7 @@ status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder> return result; } mirrorLayer->mClonedChild = mirrorFrom->createClone(); mirrorLayer->setClonedChild(mirrorFrom->createClone()); } *outLayerId = mirrorLayer->sequence; Loading
services/surfaceflinger/SurfaceFlinger.h +3 −0 Original line number Diff line number Diff line Loading @@ -316,6 +316,9 @@ public: void removeHierarchyFromOffscreenLayers(Layer* layer); void removeFromOffscreenLayers(Layer* layer); // TODO: Remove atomic if move dtor to main thread CL lands std::atomic<uint32_t> mNumClones; TransactionCallbackInvoker& getTransactionCallbackInvoker() { return mTransactionCallbackInvoker; } Loading