OSDN Git Service

libgui: Change BufferQueue to use free lists
authorDan Stoza <stoza@google.com>
Thu, 23 Apr 2015 20:20:51 +0000 (13:20 -0700)
committerDan Stoza <stoza@google.com>
Thu, 23 Apr 2015 20:25:11 +0000 (13:25 -0700)
commit0de7ea752900b5da29ad19c2799040235477f3c5
treeb24e274a53cb37a18636508db3f07b0e17393899
parentde5c15b8bd12143829d043fa4ab457600e5682b3
libgui: Change BufferQueue to use free lists

BufferQueue used to choose free buffers by scanning through its array
of slots and picking one based on timestamp. This changes that
mechanism to use a pair of free lists: one with buffers attached and
one without. This makes it easier to choose either type of free slot
depending on the needs of the current operation.

Fixes an issue with the first version of this change, found in bugs
2048295220443314, and 20464549.

Bug: 13175420
Change-Id: I9b6e83cfe8f9b4329a976025cb8e291d51fb6d4a
include/gui/BufferQueueCore.h
libs/gui/BufferQueueConsumer.cpp
libs/gui/BufferQueueCore.cpp
libs/gui/BufferQueueProducer.cpp