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

Commit e2930c4a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "SF: Allow SurfaceFlinger to be subclassed"

parents 9c81490c 58e24a36
Loading
Loading
Loading
Loading
+38 −36
Original line number Diff line number Diff line
@@ -2553,7 +2553,14 @@ void SurfaceFlinger::initScheduler(DisplayId primaryDisplayId) {

void SurfaceFlinger::commitTransaction()
{
    withTracingLock([&]() {
    withTracingLock([this]() { commitTransactionLocked(); });

    mTransactionPending = false;
    mAnimTransactionPending = false;
    mTransactionCV.broadcast();
}

void SurfaceFlinger::commitTransactionLocked() {
    if (!mLayersPendingRemoval.isEmpty()) {
        // Notify removed layers now that they can't be drawn from
        for (const auto& l : mLayersPendingRemoval) {
@@ -2593,11 +2600,6 @@ void SurfaceFlinger::commitTransaction()
    });

    commitOffscreenLayers();
    });

    mTransactionPending = false;
    mAnimTransactionPending = false;
    mTransactionCV.broadcast();
}

void SurfaceFlinger::withTracingLock(std::function<void()> lockedOperation) {
+10 −4
Original line number Diff line number Diff line
@@ -346,9 +346,11 @@ private:
    static const size_t MAX_LAYERS = 4096;
    static const int MAX_TRACING_MEMORY = 100 * 1024 * 1024; // 100MB

protected:
    // We're reference counted, never destroy SurfaceFlinger directly
    virtual ~SurfaceFlinger();

private:
    /* ------------------------------------------------------------------------
     * Internal data structures
     */
@@ -583,15 +585,19 @@ private:
    bool transactionIsReadyToBeApplied(int64_t desiredPresentTime,
                                       bool useCachedExpectedPresentTime,
                                       const Vector<ComposerState>& states);
    uint32_t setClientStateLocked(
    uint32_t setDisplayStateLocked(const DisplayState& s) REQUIRES(mStateLock);
    uint32_t addInputWindowCommands(const InputWindowCommands& inputWindowCommands)
            REQUIRES(mStateLock);

protected:
    virtual uint32_t setClientStateLocked(
            const ComposerState& composerState, int64_t desiredPresentTime, int64_t postTime,
            bool privileged,
            std::unordered_set<ListenerCallbacks, ListenerCallbacksHash>& listenerCallbacks)
            REQUIRES(mStateLock);
    uint32_t setDisplayStateLocked(const DisplayState& s) REQUIRES(mStateLock);
    uint32_t addInputWindowCommands(const InputWindowCommands& inputWindowCommands)
            REQUIRES(mStateLock);
    virtual void commitTransactionLocked();

private:
    /* ------------------------------------------------------------------------
     * Layer management
     */