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

Commit ba8f5ede authored by Marissa Wall's avatar Marissa Wall Committed by Android (Google) Code Review
Browse files

Merge changes from topic "blast-callback"

* changes:
  blast: send TransactionStats with callback
  blast: Send transaction callback
  blast: Send transaction listener from SCC to SF
  blast: Create ITransactionCompletedListener
  blast: set layers to scale to window
  blast: update hasDrawingBuffer to hasFrameUpdate
parents e0b91f35 fda30bb8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -107,6 +107,7 @@ cc_library_shared {
        "IProducerListener.cpp",
        "IProducerListener.cpp",
        "ISurfaceComposer.cpp",
        "ISurfaceComposer.cpp",
        "ISurfaceComposerClient.cpp",
        "ISurfaceComposerClient.cpp",
        "ITransactionCompletedListener.cpp",
        "LayerDebugInfo.cpp",
        "LayerDebugInfo.cpp",
        "LayerState.cpp",
        "LayerState.cpp",
        "OccupancyTracker.cpp",
        "OccupancyTracker.cpp",
+1 −1
Original line number Original line Diff line number Diff line
@@ -634,10 +634,10 @@ status_t BnSurfaceComposer::onTransact(
            if (count > data.dataSize()) {
            if (count > data.dataSize()) {
                return BAD_VALUE;
                return BAD_VALUE;
            }
            }
            ComposerState s;
            Vector<ComposerState> state;
            Vector<ComposerState> state;
            state.setCapacity(count);
            state.setCapacity(count);
            for (size_t i = 0; i < count; i++) {
            for (size_t i = 0; i < count; i++) {
                ComposerState s;
                if (s.read(data) == BAD_VALUE) {
                if (s.read(data) == BAD_VALUE) {
                    return BAD_VALUE;
                    return BAD_VALUE;
                }
                }
+167 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define LOG_TAG "ITransactionCompletedListener"
//#define LOG_NDEBUG 0

#include <gui/ITransactionCompletedListener.h>

namespace android {

namespace { // Anonymous

enum class Tag : uint32_t {
    ON_TRANSACTION_COMPLETED = IBinder::FIRST_CALL_TRANSACTION,
    LAST = ON_TRANSACTION_COMPLETED,
};

} // Anonymous namespace

status_t SurfaceStats::writeToParcel(Parcel* output) const {
    status_t err = output->writeStrongBinder(surfaceControl);
    if (err != NO_ERROR) {
        return err;
    }
    err = output->writeInt64(acquireTime);
    if (err != NO_ERROR) {
        return err;
    }
    return output->writeBool(releasePreviousBuffer);
}

status_t SurfaceStats::readFromParcel(const Parcel* input) {
    status_t err = input->readStrongBinder(&surfaceControl);
    if (err != NO_ERROR) {
        return err;
    }
    err = input->readInt64(&acquireTime);
    if (err != NO_ERROR) {
        return err;
    }
    return input->readBool(&releasePreviousBuffer);
}

status_t TransactionStats::writeToParcel(Parcel* output) const {
    status_t err = output->writeInt64(latchTime);
    if (err != NO_ERROR) {
        return err;
    }
    err = output->writeInt64(presentTime);
    if (err != NO_ERROR) {
        return err;
    }
    return output->writeParcelableVector(surfaceStats);
}

status_t TransactionStats::readFromParcel(const Parcel* input) {
    status_t err = input->readInt64(&latchTime);
    if (err != NO_ERROR) {
        return err;
    }
    err = input->readInt64(&presentTime);
    if (err != NO_ERROR) {
        return err;
    }
    return input->readParcelableVector(&surfaceStats);
}

status_t ListenerStats::writeToParcel(Parcel* output) const {
    status_t err = output->writeInt32(static_cast<int32_t>(transactionStats.size()));
    if (err != NO_ERROR) {
        return err;
    }

    for (const auto& [callbackIds, stats] : transactionStats) {
        err = output->writeParcelable(stats);
        if (err != NO_ERROR) {
            return err;
        }
        err = output->writeInt64Vector(callbackIds);
        if (err != NO_ERROR) {
            return err;
        }
    }
    return NO_ERROR;
}

status_t ListenerStats::readFromParcel(const Parcel* input) {
    int32_t transactionStats_size = input->readInt32();

    for (int i = 0; i < transactionStats_size; i++) {
        TransactionStats stats;
        std::vector<CallbackId> callbackIds;

        status_t err = input->readParcelable(&stats);
        if (err != NO_ERROR) {
            return err;
        }
        err = input->readInt64Vector(&callbackIds);
        if (err != NO_ERROR) {
            return err;
        }

        transactionStats.emplace(callbackIds, stats);
    }
    return NO_ERROR;
}

ListenerStats ListenerStats::createEmpty(const sp<ITransactionCompletedListener>& listener,
                                         const std::unordered_set<CallbackId>& callbackIds) {
    ListenerStats listenerStats;
    listenerStats.listener = listener;
    TransactionStats transactionStats;
    listenerStats.transactionStats.emplace(std::piecewise_construct,
                                           std::forward_as_tuple(callbackIds.begin(),
                                                                 callbackIds.end()),
                                           std::forward_as_tuple(transactionStats));
    return listenerStats;
}

class BpTransactionCompletedListener : public SafeBpInterface<ITransactionCompletedListener> {
public:
    explicit BpTransactionCompletedListener(const sp<IBinder>& impl)
          : SafeBpInterface<ITransactionCompletedListener>(impl, "BpTransactionCompletedListener") {
    }

    ~BpTransactionCompletedListener() override;

    void onTransactionCompleted(ListenerStats stats) override {
        callRemoteAsync<decltype(&ITransactionCompletedListener::
                                         onTransactionCompleted)>(Tag::ON_TRANSACTION_COMPLETED,
                                                                  stats);
    }
};

// Out-of-line virtual method definitions to trigger vtable emission in this translation unit (see
// clang warning -Wweak-vtables)
BpTransactionCompletedListener::~BpTransactionCompletedListener() = default;

IMPLEMENT_META_INTERFACE(TransactionCompletedListener, "android.gui.ITransactionComposerListener");

status_t BnTransactionCompletedListener::onTransact(uint32_t code, const Parcel& data,
                                                    Parcel* reply, uint32_t flags) {
    if (code < IBinder::FIRST_CALL_TRANSACTION || code > static_cast<uint32_t>(Tag::LAST)) {
        return BBinder::onTransact(code, data, reply, flags);
    }
    auto tag = static_cast<Tag>(code);
    switch (tag) {
        case Tag::ON_TRANSACTION_COMPLETED:
            return callLocalAsync(data, reply,
                                  &ITransactionCompletedListener::onTransactionCompleted);
    }
}

}; // namespace android
+19 −0
Original line number Original line Diff line number Diff line
@@ -80,6 +80,13 @@ status_t layer_state_t::write(Parcel& output) const
    memcpy(output.writeInplace(16 * sizeof(float)),
    memcpy(output.writeInplace(16 * sizeof(float)),
           colorTransform.asArray(), 16 * sizeof(float));
           colorTransform.asArray(), 16 * sizeof(float));


    if (output.writeVectorSize(listenerCallbacks) == NO_ERROR) {
        for (const auto& [listener, callbackIds] : listenerCallbacks) {
            output.writeStrongBinder(IInterface::asBinder(listener));
            output.writeInt64Vector(callbackIds);
        }
    }

    return NO_ERROR;
    return NO_ERROR;
}
}


@@ -135,6 +142,14 @@ status_t layer_state_t::read(const Parcel& input)


    colorTransform = mat4(static_cast<const float*>(input.readInplace(16 * sizeof(float))));
    colorTransform = mat4(static_cast<const float*>(input.readInplace(16 * sizeof(float))));


    int32_t listenersSize = input.readInt32();
    for (int32_t i = 0; i < listenersSize; i++) {
        auto listener = interface_cast<ITransactionCompletedListener>(input.readStrongBinder());
        std::vector<CallbackId> callbackIds;
        input.readInt64Vector(&callbackIds);
        listenerCallbacks.emplace_back(listener, callbackIds);
    }

    return NO_ERROR;
    return NO_ERROR;
}
}


@@ -323,6 +338,10 @@ void layer_state_t::merge(const layer_state_t& other) {
        what |= eColorTransformChanged;
        what |= eColorTransformChanged;
        colorTransform = other.colorTransform;
        colorTransform = other.colorTransform;
    }
    }
    if (other.what & eListenerCallbacksChanged) {
        what |= eListenerCallbacksChanged;
        listenerCallbacks = other.listenerCallbacks;
    }


    if ((other.what & what) != other.what) {
    if ((other.what & what) != other.what) {
        ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? "
        ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? "
+170 −0
Original line number Original line Diff line number Diff line
@@ -25,7 +25,9 @@
#include <utils/String8.h>
#include <utils/String8.h>
#include <utils/threads.h>
#include <utils/threads.h>


#include <binder/IPCThreadState.h>
#include <binder/IServiceManager.h>
#include <binder/IServiceManager.h>
#include <binder/ProcessState.h>


#include <system/graphics.h>
#include <system/graphics.h>


@@ -98,6 +100,61 @@ void ComposerService::composerServiceDied()


// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------


// TransactionCompletedListener does not use ANDROID_SINGLETON_STATIC_INSTANCE because it needs
// to be able to return a sp<> to its instance to pass to SurfaceFlinger.
// ANDROID_SINGLETON_STATIC_INSTANCE only allows a reference to an instance.

// 0 is an invalid callback id
TransactionCompletedListener::TransactionCompletedListener() : mCallbackIdCounter(1) {}

CallbackId TransactionCompletedListener::getNextIdLocked() {
    return mCallbackIdCounter++;
}

sp<TransactionCompletedListener> TransactionCompletedListener::getInstance() {
    static sp<TransactionCompletedListener> sInstance = new TransactionCompletedListener;
    return sInstance;
}

sp<ITransactionCompletedListener> TransactionCompletedListener::getIInstance() {
    return static_cast<sp<ITransactionCompletedListener>>(getInstance());
}

void TransactionCompletedListener::startListeningLocked() {
    if (mListening) {
        return;
    }
    ProcessState::self()->startThreadPool();
    mListening = true;
}

CallbackId TransactionCompletedListener::addCallback(const TransactionCompletedCallback& callback) {
    std::lock_guard<std::mutex> lock(mMutex);
    startListeningLocked();

    CallbackId callbackId = getNextIdLocked();
    mCallbacks.emplace(callbackId, callback);
    return callbackId;
}

void TransactionCompletedListener::onTransactionCompleted(ListenerStats listenerStats) {
    std::lock_guard lock(mMutex);

    for (const auto& [callbackIds, transactionStats] : listenerStats.transactionStats) {
        for (auto callbackId : callbackIds) {
            const auto& callback = mCallbacks[callbackId];
            if (!callback) {
                ALOGE("cannot call null callback function, skipping");
                continue;
            }
            callback(transactionStats);
            mCallbacks.erase(callbackId);
        }
    }
}

// ---------------------------------------------------------------------------

SurfaceComposerClient::Transaction::Transaction(const Transaction& other) :
SurfaceComposerClient::Transaction::Transaction(const Transaction& other) :
    mForceSynchronous(other.mForceSynchronous),
    mForceSynchronous(other.mForceSynchronous),
    mTransactionNestCount(other.mTransactionNestCount),
    mTransactionNestCount(other.mTransactionNestCount),
@@ -127,6 +184,17 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::merge(Tr
    }
    }
    other.mDisplayStates.clear();
    other.mDisplayStates.clear();


    for (const auto& [listener, callbackInfo] : other.mListenerCallbacks) {
        auto& [callbackIds, surfaceControls] = callbackInfo;
        mListenerCallbacks[listener].callbackIds.insert(std::make_move_iterator(
                                                                callbackIds.begin()),
                                                        std::make_move_iterator(callbackIds.end()));
        mListenerCallbacks[listener]
                .surfaceControls.insert(std::make_move_iterator(surfaceControls.begin()),
                                        std::make_move_iterator(surfaceControls.end()));
    }
    other.mListenerCallbacks.clear();

    return *this;
    return *this;
}
}


@@ -137,6 +205,32 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous) {


    sp<ISurfaceComposer> sf(ComposerService::getComposerService());
    sp<ISurfaceComposer> sf(ComposerService::getComposerService());


    // For every listener with registered callbacks
    for (const auto& [listener, callbackInfo] : mListenerCallbacks) {
        auto& [callbackIds, surfaceControls] = callbackInfo;
        if (callbackIds.empty()) {
            continue;
        }

        // If the listener does not have any SurfaceControls set on this Transaction, send the
        // callback now
        if (surfaceControls.empty()) {
            listener->onTransactionCompleted(ListenerStats::createEmpty(listener, callbackIds));
        }

        // If the listener has any SurfaceControls set on this Transaction update the surface state
        for (const auto& surfaceControl : surfaceControls) {
            layer_state_t* s = getLayerState(surfaceControl);
            if (!s) {
                ALOGE("failed to get layer state");
                continue;
            }
            s->what |= layer_state_t::eListenerCallbacksChanged;
            s->listenerCallbacks.emplace_back(listener, std::move(callbackIds));
        }
    }
    mListenerCallbacks.clear();

    Vector<ComposerState> composerStates;
    Vector<ComposerState> composerStates;
    Vector<DisplayState> displayStates;
    Vector<DisplayState> displayStates;
    uint32_t flags = 0;
    uint32_t flags = 0;
@@ -206,6 +300,11 @@ layer_state_t* SurfaceComposerClient::Transaction::getLayerState(const sp<Surfac
    return &(mComposerStates[sc].state);
    return &(mComposerStates[sc].state);
}
}


void SurfaceComposerClient::Transaction::registerSurfaceControlForCallback(
        const sp<SurfaceControl>& sc) {
    mListenerCallbacks[TransactionCompletedListener::getIInstance()].surfaceControls.insert(sc);
}

SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setPosition(
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setPosition(
        const sp<SurfaceControl>& sc, float x, float y) {
        const sp<SurfaceControl>& sc, float x, float y) {
    layer_state_t* s = getLayerState(sc);
    layer_state_t* s = getLayerState(sc);
@@ -216,6 +315,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setPosit
    s->what |= layer_state_t::ePositionChanged;
    s->what |= layer_state_t::ePositionChanged;
    s->x = x;
    s->x = x;
    s->y = y;
    s->y = y;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -240,6 +341,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setSize(
    s->w = w;
    s->w = w;
    s->h = h;
    s->h = h;


    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -252,6 +354,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setLayer
    }
    }
    s->what |= layer_state_t::eLayerChanged;
    s->what |= layer_state_t::eLayerChanged;
    s->z = z;
    s->z = z;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -264,6 +368,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setRelat
    s->what |= layer_state_t::eRelativeLayerChanged;
    s->what |= layer_state_t::eRelativeLayerChanged;
    s->relativeLayerHandle = relativeTo;
    s->relativeLayerHandle = relativeTo;
    s->z = z;
    s->z = z;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -283,6 +389,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFlags
    s->flags &= ~mask;
    s->flags &= ~mask;
    s->flags |= (flags & mask);
    s->flags |= (flags & mask);
    s->mask |= mask;
    s->mask |= mask;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -296,6 +404,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setTrans
    }
    }
    s->what |= layer_state_t::eTransparentRegionChanged;
    s->what |= layer_state_t::eTransparentRegionChanged;
    s->transparentRegion = transparentRegion;
    s->transparentRegion = transparentRegion;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -308,6 +418,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setAlpha
    }
    }
    s->what |= layer_state_t::eAlphaChanged;
    s->what |= layer_state_t::eAlphaChanged;
    s->alpha = alpha;
    s->alpha = alpha;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -320,6 +432,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setLayer
    }
    }
    s->what |= layer_state_t::eLayerStackChanged;
    s->what |= layer_state_t::eLayerStackChanged;
    s->layerStack = layerStack;
    s->layerStack = layerStack;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -338,6 +452,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setMatri
    matrix.dsdy = dsdy;
    matrix.dsdy = dsdy;
    matrix.dtdy = dtdy;
    matrix.dtdy = dtdy;
    s->matrix = matrix;
    s->matrix = matrix;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -350,6 +466,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setCrop_
    }
    }
    s->what |= layer_state_t::eCropChanged_legacy;
    s->what |= layer_state_t::eCropChanged_legacy;
    s->crop_legacy = crop;
    s->crop_legacy = crop;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -365,6 +483,8 @@ SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<Surfac
    s->what |= layer_state_t::eDeferTransaction_legacy;
    s->what |= layer_state_t::eDeferTransaction_legacy;
    s->barrierHandle_legacy = handle;
    s->barrierHandle_legacy = handle;
    s->frameNumber_legacy = frameNumber;
    s->frameNumber_legacy = frameNumber;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -380,6 +500,8 @@ SurfaceComposerClient::Transaction::deferTransactionUntil_legacy(const sp<Surfac
    s->what |= layer_state_t::eDeferTransaction_legacy;
    s->what |= layer_state_t::eDeferTransaction_legacy;
    s->barrierGbp_legacy = barrierSurface->getIGraphicBufferProducer();
    s->barrierGbp_legacy = barrierSurface->getIGraphicBufferProducer();
    s->frameNumber_legacy = frameNumber;
    s->frameNumber_legacy = frameNumber;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -393,6 +515,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::reparent
    }
    }
    s->what |= layer_state_t::eReparentChildren;
    s->what |= layer_state_t::eReparentChildren;
    s->reparentHandle = newParentHandle;
    s->reparentHandle = newParentHandle;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -406,6 +530,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::reparent
    }
    }
    s->what |= layer_state_t::eReparent;
    s->what |= layer_state_t::eReparent;
    s->parentHandleForChild = newParentHandle;
    s->parentHandleForChild = newParentHandle;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -419,6 +545,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setColor
    }
    }
    s->what |= layer_state_t::eColorChanged;
    s->what |= layer_state_t::eColorChanged;
    s->color = color;
    s->color = color;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -431,6 +559,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setTrans
    }
    }
    s->what |= layer_state_t::eTransformChanged;
    s->what |= layer_state_t::eTransformChanged;
    s->transform = transform;
    s->transform = transform;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -444,6 +574,8 @@ SurfaceComposerClient::Transaction::setTransformToDisplayInverse(const sp<Surfac
    }
    }
    s->what |= layer_state_t::eTransformToDisplayInverseChanged;
    s->what |= layer_state_t::eTransformToDisplayInverseChanged;
    s->transformToDisplayInverse = transformToDisplayInverse;
    s->transformToDisplayInverse = transformToDisplayInverse;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -456,6 +588,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setCrop(
    }
    }
    s->what |= layer_state_t::eCropChanged;
    s->what |= layer_state_t::eCropChanged;
    s->crop = crop;
    s->crop = crop;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -468,6 +602,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setBuffe
    }
    }
    s->what |= layer_state_t::eBufferChanged;
    s->what |= layer_state_t::eBufferChanged;
    s->buffer = buffer;
    s->buffer = buffer;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -480,6 +616,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setAcqui
    }
    }
    s->what |= layer_state_t::eAcquireFenceChanged;
    s->what |= layer_state_t::eAcquireFenceChanged;
    s->acquireFence = fence;
    s->acquireFence = fence;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -492,6 +630,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDatas
    }
    }
    s->what |= layer_state_t::eDataspaceChanged;
    s->what |= layer_state_t::eDataspaceChanged;
    s->dataspace = dataspace;
    s->dataspace = dataspace;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -504,6 +644,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setHdrMe
    }
    }
    s->what |= layer_state_t::eHdrMetadataChanged;
    s->what |= layer_state_t::eHdrMetadataChanged;
    s->hdrMetadata = hdrMetadata;
    s->hdrMetadata = hdrMetadata;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -516,6 +658,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setSurfa
    }
    }
    s->what |= layer_state_t::eSurfaceDamageRegionChanged;
    s->what |= layer_state_t::eSurfaceDamageRegionChanged;
    s->surfaceDamageRegion = surfaceDamageRegion;
    s->surfaceDamageRegion = surfaceDamageRegion;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -528,6 +672,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setApi(
    }
    }
    s->what |= layer_state_t::eApiChanged;
    s->what |= layer_state_t::eApiChanged;
    s->api = api;
    s->api = api;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -540,6 +686,22 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setSideb
    }
    }
    s->what |= layer_state_t::eSidebandStreamChanged;
    s->what |= layer_state_t::eSidebandStreamChanged;
    s->sidebandStream = sidebandStream;
    s->sidebandStream = sidebandStream;

    registerSurfaceControlForCallback(sc);
    return *this;
}

SurfaceComposerClient::Transaction&
SurfaceComposerClient::Transaction::addTransactionCompletedCallback(
        TransactionCompletedCallbackTakesContext callback, void* callbackContext) {
    auto listener = TransactionCompletedListener::getInstance();

    auto callbackWithContext = std::bind(callback, callbackContext, std::placeholders::_1);

    CallbackId callbackId = listener->addCallback(callbackWithContext);

    mListenerCallbacks[TransactionCompletedListener::getIInstance()].callbackIds.emplace(
            callbackId);
    return *this;
    return *this;
}
}


@@ -550,6 +712,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::detachCh
        mStatus = BAD_INDEX;
        mStatus = BAD_INDEX;
    }
    }
    s->what |= layer_state_t::eDetachChildren;
    s->what |= layer_state_t::eDetachChildren;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -577,6 +741,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setOverr


    s->what |= layer_state_t::eOverrideScalingModeChanged;
    s->what |= layer_state_t::eOverrideScalingModeChanged;
    s->overrideScalingMode = overrideScalingMode;
    s->overrideScalingMode = overrideScalingMode;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -588,6 +754,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setGeome
        return *this;
        return *this;
    }
    }
    s->what |= layer_state_t::eGeometryAppliesWithResize;
    s->what |= layer_state_t::eGeometryAppliesWithResize;

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


@@ -611,6 +779,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setColor
    }
    }
    s->what |= layer_state_t::eColorTransformChanged;
    s->what |= layer_state_t::eColorTransformChanged;
    s->colorTransform = mat4(matrix, translation);
    s->colorTransform = mat4(matrix, translation);

    registerSurfaceControlForCallback(sc);
    return *this;
    return *this;
}
}


Loading