blast: update hasDrawingBuffer to hasFrameUpdate

hasFrameUpdate is a more accurate name than hasDrawingBuffer.
Also keep track of when the current state has been modified
and only return true for BufferStateLayer::hasFrameUpdate
when the state has been modified and the buffer is not null.

Test: Transaction_test
Bug: 80477568

Change-Id: Icec6cf62490799988bd967914986bf92a07ce726
diff --git a/services/surfaceflinger/BufferStateLayer.cpp b/services/surfaceflinger/BufferStateLayer.cpp
index 73098bf..9edff21 100644
--- a/services/surfaceflinger/BufferStateLayer.cpp
+++ b/services/surfaceflinger/BufferStateLayer.cpp
@@ -61,7 +61,7 @@
         return true;
     }
 
-    return hasDrawingBuffer();
+    return hasFrameUpdate();
 }
 
 bool BufferStateLayer::getTransformToDisplayInverse() const {
@@ -81,6 +81,7 @@
     while (!mPendingStates.empty()) {
         popPendingState(stateToCommit);
     }
+    mCurrentStateModified = stateUpdateAvailable && mCurrentState.modified;
     mCurrentState.modified = false;
     return stateUpdateAvailable;
 }
@@ -314,8 +315,8 @@
     return {};
 }
 
-bool BufferStateLayer::hasDrawingBuffer() const {
-    return getDrawingState().buffer != nullptr;
+bool BufferStateLayer::hasFrameUpdate() const {
+    return mCurrentStateModified && getCurrentState().buffer != nullptr;
 }
 
 void BufferStateLayer::setFilteringEnabled(bool enabled) {
@@ -513,6 +514,7 @@
               s.buffer->handle, to_string(error).c_str(), static_cast<int32_t>(error));
     }
 
+    mCurrentStateModified = false;
     mFrameNumber++;
 }