OSDN Git Service

Eliminate unnecessary calls to onBufferReleased
authorMatthew Bouyack <mbouyack@google.com>
Mon, 3 Oct 2016 23:24:26 +0000 (16:24 -0700)
committerMatthew Bouyack <mbouyack@google.com>
Tue, 4 Oct 2016 19:57:38 +0000 (12:57 -0700)
commit3b8e6b2f30af0564538c2a660033d6a97ab8038f
tree24513f55fef74732248dd0402e9ff03658658fd4
parent3169437feb387b56499208464960d281bd9b87c9
Eliminate unnecessary calls to onBufferReleased

This change adds a callback to ProducerListener to indicate whether the
listener needs the 'onBufferReleased' notification. This allows us to
avoid making that binder call unnecessarily, saving ~170us per frame on
Android Wear.

By default the new callback returns true, so behavior for existing
clients should be unchanged. Only the DummyProducerListener returns
false.

Also note that it would be simpler to just pass NULL for the
ProducerListener if not for that fact that we still need it for death
notification.

Bug: b/31122630

Change-Id: I730834218a055d89e89f876dd77da8127eb78000
include/gui/BufferQueueCore.h
include/gui/IProducerListener.h
libs/gui/BufferQueueCore.cpp
libs/gui/BufferQueueProducer.cpp
libs/gui/IProducerListener.cpp