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

Commit 9542f9d9 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "SF: Add autorefresh to drawingstate"

parents 7e1ee565 86653e9e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ protected:
    // the mStateLock.
    ui::Transform::RotationFlags mTransformHint = ui::Transform::ROT_0;

    bool getAutoRefresh() const { return mAutoRefresh; }
    bool getAutoRefresh() const { return mDrawingState.autoRefresh; }
    bool getSidebandStreamChanged() const { return mSidebandStreamChanged; }

    // Returns true if the next buffer should be presented at the expected present time
@@ -182,7 +182,6 @@ protected:
    // specific logic
    virtual bool isBufferDue(nsecs_t /*expectedPresentTime*/) const = 0;

    std::atomic<bool> mAutoRefresh{false};
    std::atomic<bool> mSidebandStreamChanged{false};

private:
+2 −2
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ status_t BufferQueueLayer::updateTexImage(bool& recomputeVisibleRegions, nsecs_t
    bool autoRefresh;
    status_t updateResult = mConsumer->updateTexImage(&r, expectedPresentTime, &autoRefresh,
                                                      &queuedBuffer, maxFrameNumberToAcquire);
    mAutoRefresh = autoRefresh;
    mDrawingState.autoRefresh = autoRefresh;
    if (updateResult == BufferQueue::PRESENT_LATER) {
        // Producer doesn't want buffer to be displayed yet.  Signal a
        // layer update so we check again at the next opportunity.
@@ -300,7 +300,7 @@ status_t BufferQueueLayer::updateTexImage(bool& recomputeVisibleRegions, nsecs_t

    // Decrement the queued-frames count.  Signal another event if we
    // have more frames pending.
    if ((queuedBuffer && more_frames_pending) || mAutoRefresh) {
    if ((queuedBuffer && more_frames_pending) || mDrawingState.autoRefresh) {
        mFlinger->onLayerUpdate();
    }

+1 −3
Original line number Diff line number Diff line
@@ -667,9 +667,7 @@ bool BufferStateLayer::onPreComposition(nsecs_t refreshStartTime) {
}

void BufferStateLayer::setAutoRefresh(bool autoRefresh) {
    if (!mAutoRefresh.exchange(autoRefresh)) {
        mFlinger->onLayerUpdate();
    }
    mDrawingState.autoRefresh = autoRefresh;
}

bool BufferStateLayer::latchSidebandStream(bool& recomputeVisibleRegions) {
+2 −0
Original line number Diff line number Diff line
@@ -280,6 +280,8 @@ public:
        sp<IBinder> releaseBufferEndpoint;

        gui::DropInputMode dropInputMode;

        bool autoRefresh = false;
    };

    /*