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

Commit 0a3a2b53 authored by Marissa Wall's avatar Marissa Wall
Browse files

blast: adding a buffer doesn't make the frame dirty

The frame shouldn't be marked as dirty when a new buffer is set.
When a frame is marked as dirty, it forces SurfaceFlinger to do
extra work on the CPU which hurts power/performance.

Bug: 125859110
Test: Take a systrace when running the Blast Chrome.apk. Check that
      there is no extra work done.

Change-Id: I0cf9802f495a7e9f2e5b1f4e58f0a7a4a75d8225
parent b2069eba
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -198,7 +198,6 @@ bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer) {
        mReleasePreviousBuffer = true;
    }

    mCurrentState.sequence++;
    mCurrentState.buffer = buffer;
    mCurrentState.modified = true;
    setTransactionFlags(eTransactionNeeded);
@@ -217,7 +216,6 @@ bool BufferStateLayer::setAcquireFence(const sp<Fence>& fence) {

bool BufferStateLayer::setDataspace(ui::Dataspace dataspace) {
    if (mCurrentState.dataspace == dataspace) return false;
    mCurrentState.sequence++;
    mCurrentState.dataspace = dataspace;
    mCurrentState.modified = true;
    setTransactionFlags(eTransactionNeeded);