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

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

Merge "Discard invisible surfaces"

parents d900c324 cd11bd59
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -381,6 +381,15 @@ void DisplaySurface::OnPostConsumer(
  ATRACE_NAME("DisplaySurface::OnPostConsumer");
  std::lock_guard<std::mutex> autolock(lock_);

  if (!IsVisible()) {
    ALOGD_IF(TRACE,
             "DisplaySurface::OnPostConsumer: Discarding buffer_id=%d on "
             "invisible surface.",
             consumer->id());
    consumer->Discard();
    return;
  }

  if (posted_buffers_.IsFull()) {
    ALOGE("Error: posted buffers full, overwriting");
    posted_buffers_.PopBack();