Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 577c8961 authored by David Sodman's avatar David Sodman
Browse files

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
parent ee5d8240
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -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()) {
+11 −0
Original line number Diff line number Diff line
@@ -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);
}