summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author David Sodman <dsodman@google.com> 2017-12-08 14:50:53 -0800
committer David Sodman <dsodman@google.com> 2017-12-08 16:47:15 -0800
commit577c896102ebb13f9496a94674b4ca9cd15fe0ad (patch)
treebb0e548aea1c497fb62e2863b58dd8a5f433c574
parentee5d8240ec50df8910fcddc56df360df7a76c0dc (diff)
SurfaceFlinger: Move generic dtor logic to Layer
Move Layer generic code from BufferLayer destructor to the Layer destructor so that ColorLayer will be able to use it. Bug: 69127378 Test: CTS SurfaceView tests Change-Id: Ie48ee2c3433e80bcae822654d4dc186d09c49c00
-rw-r--r--services/surfaceflinger/BufferLayer.cpp11
-rw-r--r--services/surfaceflinger/Layer.cpp11
2 files changed, 11 insertions, 11 deletions
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index e8f4150135..7d9d4f6969 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -75,17 +75,6 @@ BufferLayer::BufferLayer(SurfaceFlinger* flinger, const sp<Client>& client, cons
}
BufferLayer::~BufferLayer() {
- sp<Client> c(mClientRef.promote());
- if (c != 0) {
- c->detachLayer(this);
- }
-
- for (auto& point : mRemoteSyncPoints) {
- point->setTransactionApplied();
- }
- for (auto& point : mLocalSyncPoints) {
- point->setFrameAvailable();
- }
mFlinger->deleteTextureAsync(mTextureName);
if (!getBE().mHwcLayers.empty()) {
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index fa4d289249..13df1e21b4 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -142,6 +142,17 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, const String8& n
void Layer::onFirstRef() {}
Layer::~Layer() {
+ sp<Client> c(mClientRef.promote());
+ if (c != 0) {
+ c->detachLayer(this);
+ }
+
+ for (auto& point : mRemoteSyncPoints) {
+ point->setTransactionApplied();
+ }
+ for (auto& point : mLocalSyncPoints) {
+ point->setFrameAvailable();
+ }
mFrameTracker.logAndResetStats(mName);
}