Loading services/surfaceflinger/Client.cpp +1 −4 Original line number Original line Diff line number Diff line Loading @@ -43,10 +43,7 @@ Client::~Client() { { const size_t count = mLayers.size(); const size_t count = mLayers.size(); for (size_t i=0 ; i<count ; i++) { for (size_t i=0 ; i<count ; i++) { sp<Layer> layer(mLayers.valueAt(i).promote()); mFlinger->removeLayer(mLayers.valueAt(i)); if (layer != 0) { mFlinger->removeLayer(layer); } } } } } Loading services/surfaceflinger/Layer.cpp +8 −3 Original line number Original line Diff line number Diff line Loading @@ -1289,9 +1289,14 @@ void Layer::pushPendingState() { // If this transaction is waiting on the receipt of a frame, generate a sync // If this transaction is waiting on the receipt of a frame, generate a sync // point and send it to the remote layer. // point and send it to the remote layer. if (mCurrentState.handle != nullptr) { if (mCurrentState.handle != nullptr) { sp<Handle> handle = static_cast<Handle*>(mCurrentState.handle.get()); sp<IBinder> strongBinder = mCurrentState.handle.promote(); sp<Layer> handleLayer = handle->owner.promote(); sp<Handle> handle = nullptr; if (handleLayer == nullptr) { sp<Layer> handleLayer = nullptr; if (strongBinder != nullptr) { handle = static_cast<Handle*>(strongBinder.get()); handleLayer = handle->owner.promote(); } if (strongBinder == nullptr || handleLayer == nullptr) { ALOGE("[%s] Unable to promote Layer handle", mName.string()); ALOGE("[%s] Unable to promote Layer handle", mName.string()); // If we can't promote the layer we are intended to wait on, // If we can't promote the layer we are intended to wait on, // then it is expired or otherwise invalid. Allow this transaction // then it is expired or otherwise invalid. Allow this transaction Loading services/surfaceflinger/Layer.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -124,7 +124,7 @@ public: // If set, defers this state update until the Layer identified by handle // If set, defers this state update until the Layer identified by handle // receives a frame with the given frameNumber // receives a frame with the given frameNumber sp<IBinder> handle; wp<IBinder> handle; uint64_t frameNumber; uint64_t frameNumber; // the transparentRegion hint is a bit special, it's latched only // the transparentRegion hint is a bit special, it's latched only Loading services/surfaceflinger/SurfaceFlinger.cpp +8 −9 Original line number Original line Diff line number Diff line Loading @@ -2106,8 +2106,14 @@ status_t SurfaceFlinger::addClientLayer(const sp<Client>& client, return NO_ERROR; return NO_ERROR; } } status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer) { status_t SurfaceFlinger::removeLayer(const wp<Layer>& weakLayer) { Mutex::Autolock _l(mStateLock); Mutex::Autolock _l(mStateLock); sp<Layer> layer = weakLayer.promote(); if (layer == nullptr) { // The layer has already been removed, carry on return NO_ERROR; } ssize_t index = mCurrentState.layersSortedByZ.remove(layer); ssize_t index = mCurrentState.layersSortedByZ.remove(layer); if (index >= 0) { if (index >= 0) { mLayersPendingRemoval.push(layer); mLayersPendingRemoval.push(layer); Loading Loading @@ -2448,14 +2454,7 @@ status_t SurfaceFlinger::onLayerDestroyed(const wp<Layer>& layer) { { // called by ~LayerCleaner() when all references to the IBinder (handle) // called by ~LayerCleaner() when all references to the IBinder (handle) // are gone // are gone status_t err = NO_ERROR; return removeLayer(layer); sp<Layer> l(layer.promote()); if (l != NULL) { err = removeLayer(l); ALOGE_IF(err<0 && err != NAME_NOT_FOUND, "error removing layer=%p (%s)", l.get(), strerror(-err)); } return err; } } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading services/surfaceflinger/SurfaceFlinger.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -311,7 +311,7 @@ private: status_t onLayerDestroyed(const wp<Layer>& layer); status_t onLayerDestroyed(const wp<Layer>& layer); // remove a layer from SurfaceFlinger immediately // remove a layer from SurfaceFlinger immediately status_t removeLayer(const sp<Layer>& layer); status_t removeLayer(const wp<Layer>& layer); // add a layer to SurfaceFlinger // add a layer to SurfaceFlinger status_t addClientLayer(const sp<Client>& client, status_t addClientLayer(const sp<Client>& client, Loading Loading
services/surfaceflinger/Client.cpp +1 −4 Original line number Original line Diff line number Diff line Loading @@ -43,10 +43,7 @@ Client::~Client() { { const size_t count = mLayers.size(); const size_t count = mLayers.size(); for (size_t i=0 ; i<count ; i++) { for (size_t i=0 ; i<count ; i++) { sp<Layer> layer(mLayers.valueAt(i).promote()); mFlinger->removeLayer(mLayers.valueAt(i)); if (layer != 0) { mFlinger->removeLayer(layer); } } } } } Loading
services/surfaceflinger/Layer.cpp +8 −3 Original line number Original line Diff line number Diff line Loading @@ -1289,9 +1289,14 @@ void Layer::pushPendingState() { // If this transaction is waiting on the receipt of a frame, generate a sync // If this transaction is waiting on the receipt of a frame, generate a sync // point and send it to the remote layer. // point and send it to the remote layer. if (mCurrentState.handle != nullptr) { if (mCurrentState.handle != nullptr) { sp<Handle> handle = static_cast<Handle*>(mCurrentState.handle.get()); sp<IBinder> strongBinder = mCurrentState.handle.promote(); sp<Layer> handleLayer = handle->owner.promote(); sp<Handle> handle = nullptr; if (handleLayer == nullptr) { sp<Layer> handleLayer = nullptr; if (strongBinder != nullptr) { handle = static_cast<Handle*>(strongBinder.get()); handleLayer = handle->owner.promote(); } if (strongBinder == nullptr || handleLayer == nullptr) { ALOGE("[%s] Unable to promote Layer handle", mName.string()); ALOGE("[%s] Unable to promote Layer handle", mName.string()); // If we can't promote the layer we are intended to wait on, // If we can't promote the layer we are intended to wait on, // then it is expired or otherwise invalid. Allow this transaction // then it is expired or otherwise invalid. Allow this transaction Loading
services/surfaceflinger/Layer.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -124,7 +124,7 @@ public: // If set, defers this state update until the Layer identified by handle // If set, defers this state update until the Layer identified by handle // receives a frame with the given frameNumber // receives a frame with the given frameNumber sp<IBinder> handle; wp<IBinder> handle; uint64_t frameNumber; uint64_t frameNumber; // the transparentRegion hint is a bit special, it's latched only // the transparentRegion hint is a bit special, it's latched only Loading
services/surfaceflinger/SurfaceFlinger.cpp +8 −9 Original line number Original line Diff line number Diff line Loading @@ -2106,8 +2106,14 @@ status_t SurfaceFlinger::addClientLayer(const sp<Client>& client, return NO_ERROR; return NO_ERROR; } } status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer) { status_t SurfaceFlinger::removeLayer(const wp<Layer>& weakLayer) { Mutex::Autolock _l(mStateLock); Mutex::Autolock _l(mStateLock); sp<Layer> layer = weakLayer.promote(); if (layer == nullptr) { // The layer has already been removed, carry on return NO_ERROR; } ssize_t index = mCurrentState.layersSortedByZ.remove(layer); ssize_t index = mCurrentState.layersSortedByZ.remove(layer); if (index >= 0) { if (index >= 0) { mLayersPendingRemoval.push(layer); mLayersPendingRemoval.push(layer); Loading Loading @@ -2448,14 +2454,7 @@ status_t SurfaceFlinger::onLayerDestroyed(const wp<Layer>& layer) { { // called by ~LayerCleaner() when all references to the IBinder (handle) // called by ~LayerCleaner() when all references to the IBinder (handle) // are gone // are gone status_t err = NO_ERROR; return removeLayer(layer); sp<Layer> l(layer.promote()); if (l != NULL) { err = removeLayer(l); ALOGE_IF(err<0 && err != NAME_NOT_FOUND, "error removing layer=%p (%s)", l.get(), strerror(-err)); } return err; } } // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- Loading
services/surfaceflinger/SurfaceFlinger.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -311,7 +311,7 @@ private: status_t onLayerDestroyed(const wp<Layer>& layer); status_t onLayerDestroyed(const wp<Layer>& layer); // remove a layer from SurfaceFlinger immediately // remove a layer from SurfaceFlinger immediately status_t removeLayer(const sp<Layer>& layer); status_t removeLayer(const wp<Layer>& layer); // add a layer to SurfaceFlinger // add a layer to SurfaceFlinger status_t addClientLayer(const sp<Client>& client, status_t addClientLayer(const sp<Client>& client, Loading