SF: Add autorefresh to drawingstate
Autorefresh does not need to be an atomic variable. It is
only accessed from the main thread. Move it to drawing
state so it can be accessed from the base Layer class when
creating the starting state.
Test: presubmit
Bug: 200284593
Change-Id: I52a00c4185a3a883e4d5cf850257bb3a098b4d22
diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp
index 8aecec1..28c387e 100644
--- a/services/surfaceflinger/BufferQueueLayer.cpp
+++ b/services/surfaceflinger/BufferQueueLayer.cpp
@@ -216,7 +216,7 @@
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 @@
// 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();
}