History log of /frameworks/native/libs/gui/tests/BufferQueue_test.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fc333972e92e176ea73b34c5c6c25fc5875140be 19-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Return error when trying to disconnect twice" into oc-dev
0c9a1ed91f8e19887ac43eff5af16e59878c8226 07-Apr-2017 Dan Stoza <stoza@google.com> libgui: Normalize IGraphicBufferConsumer methods

This change modifies IGraphicBufferConsumer such that all synchronous
methods return a status_t and, as such, all outputs are returned by
output parameter rather than return value. It also eliminates the use
of a const char* parameter that SafeInterface can't handle.

Test: m -j + libgui_tests + manual testing
Change-Id: I9bb0e2892492d5e0a3f660bf228834b9ed014539
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
3e198b2b331c09e8d078b5cd4cb770bcf049c0d1 08-Apr-2017 Wonsik Kim <wonsik@google.com> Return error when trying to disconnect twice

Bug: 34637488
Bug: 36737364
Test: cts-tradefed run cts-dev --module Graphics
Test: libgui_test
Change-Id: I9deb1e8978e3789269ed1cf9753892b68f246e0f
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
88752d7f1a13a425c59c429f0986f6f899b7826b 27-Mar-2017 Kalle Raita <kraita@google.com> Disable BufferQueueInAnotherProcess test

The BufferQueueInAnotherProcess relies on executing before any test that
tries to open a BufferQueue in the local process. A recent test addition
broke the condition. Upcoming SF & BQ changes are likely to obsolete the
test, so won't spend time on fixing it. Disabling for now and the test
will be removed when the infrastructure changes land.

Test: libgui_test
Bug: 36592665
Change-Id: I648e197cab6bab3aed445390069265589a717bf1
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
d4c6f9912fa4f9d6a5a2e51672adf27c7a1c8624 21-Mar-2017 Dan Stoza <stoza@google.com> BQ: Resend queued buffer handles after disconnect

When the producer disconnects from a BufferQueue, all of its slots are
cleared and buffers in the queue are marked as stale. When the slots
are cleared, we notify the consumer that buffers were released so that
it can clear its cache of slot-to-buffer mappings.

However, when we were marking queued buffers as stale, we were not
clearing the bit that dictates whether the BQ needs to send a buffer
handle upon acquire, so in the case where the producer queues a buffer
and disconnects, and then the consumer acquires that queued buffer,
the consumer doesn't get the buffer handle, nor can it retrieve it from
its cache, because it has (or should have) already cleared it.

This change clears that bit upon disconnect.

Bug: 36453246
Test: New test in libgui_tests + Vulkan CTS test from bug
Change-Id: Ic27f119a4164878257c3841b4e1d421694159774
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
22f842ba04c32cef2faf855dc304eb0ab131b9ec 19-Jan-2017 Shuzhen Wang <shuzhenwang@google.com> BufferQueue: Add bufferReplaced flag in QueueBufferOutput

For async buffer queue, when queueBuffer overwrites a previously queued
buffer, because consumer won't be able to acquire the overwritten
buffer, onBufferReleased isn't triggered either.

This makes it difficult to track which buffer in the buffer queue
becomes free other than calling dequeueBuffer(). Adding a flag in
QueueBufferOutput addresses this issue.

Test: TestBufferReplacedInQueueBuffer in BufferQueue_tests
Bug: 34481539
Change-Id: Ic7f4be2d3f9691dd6b007a450240614c0c420f0d
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
7c3ba8aa288755fad78ddbabcee0ad5a0610ac1c 25-Jul-2016 Brian Anderson <brianderson@google.com> Update producer's cache of frame events in de/queue

* Cache is only updated during queue and dequeue if
the getFrameTimestamps is enabled.
* The consumer avoids sending a copy of the acquire
fence back to the producer since the producer
already has a copy.

Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*

Change-Id: I6a8b965ae79441a40893b5df937f9ed004fe7359
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
3d1d280fa3cbc30700f728a4b13e5308315433d3 27-Sep-2016 Colin Cross <ccross@android.com> Rename dump methods to dumpState

The dump methods shadow the IBinder dump method. The warnings were being
hidden by the use of -isystem to include frameworks/native/include.

Bug: 31752268
Test: m -j
Change-Id: Iafc64da43032d5d9d84b64640e70d93fd7051bcf
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
bc2df65a3f3f4b8abaaaa2a4e576a3a42c2d30f3 22-Jul-2016 Eino-Ville Talvala <etalvala@google.com> BufferQueue consumers: Add discardFreeBuffer method

This method releases all free buffers owned by the buffer queue,
in order to save memory (at the cost of potential future
reallocation of buffers).

Bug: 28695173
Change-Id: I458d10373e639e3144faf673af2ba01aca36e65a
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
e77c7669bee30b7c0099172cf0c38cef92412040 13-May-2016 Dan Stoza <stoza@google.com> BufferQueue/SF: Add OccupancyTracker

Adds an OccupancyTracker to BufferQueue. This module keeps track of
how many buffers are in the queue over time, which, in combination
with various aggregation of these statistics, allows SurfaceFlinger
to report what fraction of the time a given layer was double- or
triple-buffered.

Change-Id: Ida6e967dc5483c00a633e9fe03998e420dd88502
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
1a61da5e28fa16ad556a58193c8bbeb32a5f636d 28-Apr-2016 John Reck <jreck@google.com> Return the transform to apply in getLastQueuedBuffer

Bug: 28428955
Change-Id: Id48f7d3bf3f5deb074cf0a6a52a41caac875db41
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
50101d02a8eae555887282a5f761fdec57bdaf30 08-Apr-2016 Dan Stoza <stoza@google.com> libgui: Add getLastQueuedBuffer to BufferQueue

Adds the ability to get the last buffer queued to a BufferQueue plus
its acquire fence.

Bug: 27708453
Change-Id: Iee39475740b40c854a5f46178b2934fd930e61b8
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
3559fbf93801e2c0d9d8fb246fb9b867a361b464 17-Mar-2016 Pablo Ceballos <pceballos@google.com> Rename single buffer mode to shared buffer mode

Change-Id: Id43d0737d9367981644e498942ebc0077d61038c
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
295a9fc8aa87daa2cded5c1a279b8cd24e9a9a9f 15-Mar-2016 Pablo Ceballos <pceballos@google.com> BQ: Allow shared buffer to be the first queued buffer

- When single-buffer mode is enabled the shared buffer will now be
either the first buffer dequeued or the first buffer queued.
Whichever comes first.

Bug 24940410

Change-Id: I9f7e2630640e37fe1fb967aed41a3025567247a8
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
ff95aabbcc6e8606acbd7933c90eeb9b8b382a21 14-Jan-2016 Pablo Ceballos <pceballos@google.com> Add interface for controlling single buffer auto refresh

- Adds a boolean to BufferQueue that controls whether or not auto
refresh is enabled in SurfaceFlinger when in single buffer mode.
- Adds plumbing up to ANativeWindow.
- When enabled, it will cache the shared buffer slot in Surface in
order to prevent the Binder transaction with SurfaceFlinger.

Bug 24940410

Change-Id: I83142afdc00e203f198a32288f071d926f8fda95
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
72daab652e3481566c01ce45c6afdb9fcec6f140 08-Dec-2015 Pablo Ceballos <pceballos@google.com> BQ: Flexible resizing

- Allow the producer to call setMaxDequeuedBufferCount and the
consumer to call setMaxAcquiredBufferCount when buffers are
currently dequeued/acquired as long as the new value is not less
than the number of dequeued/acquired buffers.

Bug 22768206

Change-Id: I599a4027a6ae9cb0a1c0d5ec60cb5e65b86a345b
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
5ecfb68ffd63d352df0392dca6e95ef67a66c679 05-Jan-2016 Dan Stoza <stoza@google.com> libgui: Fix attaching buffers without allocation

This changes the way that BufferQueue selects slots in
waitForFreeSlotThenRelock. This method is called from both
dequeueBuffer and attachBuffer, but those two methods actually have
different preferences:

dequeueBuffer wants a slot with a buffer if possible (to avoid
unnecessary allocations), but will settle for a slot without a buffer
if no free buffers are available.

attachBuffer wants a slot without a buffer if possible (to avoid
clobbering an existing buffer), but will settle with clobbering a free
buffer if no empty slots are available.

These preferences are now respected, which has the side-effect of
fixing a bug where it was not possible to attach a buffer if allocation
is disabled (since the previous implementation assumed finding a slot
without a buffer meant that the caller intended to allocate a buffer,
which would accordingly be blocked since allocation is disabled).

Bug: 26387372
Change-Id: Iefd550fd01925d8c51d6f062d5708d1f6d517edd
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
127fc63e8a15366b4395f1363e8e18eb058d1709 30-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add dequeue/attach timeout

Adds the ability to specify the timeout when dequeueBuffer or
attachBuffer block due to the lack of a free buffer/slot. By default,
these will block indefinitely (which is signified by a timeout of -1).

When a timeout (other than -1) is specified, non-blocking mode is
disabled and the given timeout will be used instead.

Bug: 25196773
Change-Id: I17fdbeebccb7c8d878703d758ac1209608258e61
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
ccdfd60d79a8b7f1ed6401d0f2e8e29166a10584 08-Oct-2015 Pablo Ceballos <pceballos@google.com> BQ: Add support for single buffer mode

- Adds a single buffer mode to BufferQueue. In this mode designate the
first dequeued buffer as the shared buffer. All calls to dequeue()
and acquire() will then return the shared buffer, allowing the
producer and consumer to share it.
- Modify the buffer slot state tracking. Add a new SHARED state for
the shared buffer in single buffer mode. Also track how many times
a buffer has been dequeued/queued/acquired as it's possible for a
shared buffer to be both dequeued and acquired at the same time, or
dequeued/acquired multiple times. This tracking is needed to know
when to drop the buffer out of the SHARED state after single buffer
mode has been disabled.
- Add plumbing for enabling/disabling single buffer mode from Surface.

Bug 24940410

Change-Id: I3fc550c74bacb5523c049a227111356257386853
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
567dbbb6dd42be5013fcde0dadb3316d85f2fa0d 27-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: get rid of async in producer interface

- Get rid of the async flag in dequeueBuffer, allocateBuffers,
waitForFreeSlotThenRelock, and QueueBufferInput.
- Instead use the persistent flags mDequeueBufferCannotBlock and
mAsyncMode to determine whether to use the async behavior.

Bug 13174928

Change-Id: Ie6f7b9e46ee3844ee77b102003c84dddf1bcafdd
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
ff12cba77b5b88f3978070bb970d7721225271ee 16-Sep-2015 Pablo Ceballos <pceballos@google.com> Merge "BQ: Modify consumer buffer count interfaces"
4aa427b964f22e3cf10381f8fc27e7042c322b9c 14-Sep-2015 Pablo Ceballos <pceballos@google.com> Merge "native: Rename mBuf to mSlot"
19e3e06e3c65a7c001a6fe0971744ba5ff536515 20-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: Modify consumer buffer count interfaces

- Rename setDefaultMaxBufferCount() to setMaxBufferCount(). Modify it
to be hard maximum on the number of buffers that can't be overwritten
by the producer.
- Enforce the maximum buffer count in setMaxAcquiredBufferCount(),
setMaxDequeuedBufferCount(), and setAsyncMode().
- Remove mOverrideMaxBufferCount as it's no longer needed since
overriding is no longer possible.
- Expose setMaxAcquiredBufferCount() in GLConsumer.
- Remove disableAsyncBuffer(), it was only being used for single buffer
mode. Single buffer mode is now achievable with setMaxBufferCount().

Bug 13174928

Change-Id: Ia33799f42751272a711fbd8559f7602ce9f18e4f
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
fa455354557f6283ff3a7d76979e52fd251c155f 13-Aug-2015 Pablo Ceballos <pceballos@google.com> BQ: add setMaxDequeuedBufferCount

Adds the new setMaxDequeuedBufferCount() function to
BufferQueueProducer. This will eventually replace setBufferCount.

Also add setAsyncMode.

Bug 13174928

Change-Id: Iea1adcd5d74a75f67d8e9dde06d521695628ad5a
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
47650f4f66a49e1815ad08ca4fb12a661d133abc 05-Aug-2015 Pablo Ceballos <pceballos@google.com> native: Rename mBuf to mSlot

Remove the union in BufferItem.

Bug: 19769719
Change-Id: I4e496b5aafce0fc5206dc7551a741f9c262c2cd0
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
c6f30bdee1f634eb90d68cb76efe935b6535a1e8 08-Jun-2015 Dan Stoza <stoza@google.com> libgui/SurfaceFlinger: Add getConsumerName

Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is update on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: I22c7881d778e495cf8276de7bbcd769e52429915
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
a2ca9bf0a9789e9e5e37961ebfb356347f59309e 08-Jun-2015 Dan Stoza <stoza@google.com> Revert "libgui: Add getConsumerName"

This reverts commit 107fbe5599016b0e35145a1a00c4f238b63d61e4.

Change-Id: I0c2b0f7c81193b05eb3dd2f5a59f83598434b744
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
107fbe5599016b0e35145a1a00c4f238b63d61e4 06-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add getConsumerName

Adds a getConsumerName method to IGraphicBufferProducer and Surface.
Currently, the name is cached inside of IGBP and is updated on connect
and dequeueBuffer, which should be good enough for most uses.

Bug: 6667401
Change-Id: Ife94bd89023fe7c00bad916932b9a19233fd2290
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
812ed0644f8f8f71ca403f4e5793f0dbc1fcf9b2 03-Jun-2015 Dan Stoza <stoza@google.com> libgui: Add generation numbers to BufferQueue

This change allows producers to set a generation number on a
BufferQueue. This number will be embedded in any new GraphicBuffers
created in that BufferQueue, and attempts to attach buffers which have
a different generation number will fail.

It also plumbs the setGenerationNumber method through Surface, with the
additional effect that any buffers attached to the Surface after
setting a new generation number will automatically be updated with the
new number (as opposed to failing, as would happen on through IGBP).

Bug: 20923096
Change-Id: I32bf726b035f99c3e5834beaf76afb9f01adcbc2
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
958f501189a29e53767f41bc8172e4af8d1ce2bf 24-Apr-2015 Dan Stoza <stoza@google.com> Merge "libgui: Allow an IGBProducer to disable allocation"
9de7293b0a1b01ebe6fb1ab4a498f144adc8029f 17-Apr-2015 Dan Stoza <stoza@google.com> libgui: Allow an IGBProducer to disable allocation

Adds a new method IGBP::allowAllocation, which controls whether
dequeueBuffer is permitted to allocate a new buffer. If allocation is
disallowed, dequeueBuffer will block or return an error as it
normally would (as controlled by *ControlledByApp).

If there are free buffers, but they are not of the correct dimensions,
format, or usage, they may be freed if a more suitable buffer is not
found first.

Bug: 19801715
Change-Id: I0d604958b78b2fd775c2547690301423f9a52165
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
f8cebe54576c8100769e2515d4f67bdd013a6927 20-Apr-2015 Dan Stoza <stoza@google.com> libgui: Fix some bitrot/warnings in tests

These tests hadn't been run in a while and had accumulated some rot.
This fixes most of the compile warnings and some tests which fail
incorrectly, but 2 failures remain on N6.

Change-Id: I7fee78cd058a32f4d7df40ec9f899ff767f68517
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
cf3834db104e0b052056e3a06d46e3f222f0d372 11-Mar-2015 Dan Stoza <stoza@google.com> DO NOT MERGE libgui: Prepare for IGBC::BufferItem removal

Currently, there are two instances of BufferItem: one inside of
IGraphicBufferConsumer, and a standalone one inside of libgui. They
only differ in the name of one of the fields, and we want to remove
the IGBC version. This changes things so that client code may be
incrementally switched over to the libgui version.

This is a squashed commit containing the following changes:
I64f495105f56cbf5803cea4aa6b072ea29b70cf5
I1394e693314429ada93427889f10b7b01c948053
I9c3bc8037fa9438d4d9080b8afb694219ef2f71f
I699ed0a6837076867ca756b28d1ffb2238f7a0d9
Iac8425e1241774304a131da2fb9dec6e82922f13

Change-Id: Ic4d51f5df6dbc70b376d13fceba2335b9bae4f3d
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
82c6bcc9705eabcaf5b9e45bc81867b0e2d61a02 20-Feb-2015 Eino-Ville Talvala <etalvala@google.com> DO NOT MERGE Add dataSpace to buffer queues; remove old format enums.

- Wire up new dataSpace parameter through buffer queue stack
- Update tests to include the parameter
- Switch eglApi to using dataSpace to indicate sRGB gamma/linear
difference
- Remove RAW_SENSOR in favor of RAW16
- Remove use of sRGB format enums
- Add default dataspace to buffer queue core
- Add query for default dataspace

Cherry pick of I070bd2e7c56506055c419004c29e2e3feac725df

Change-Id: I461952389c18051176c6b75e664f20ad369f5760
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
e12cfc23b2399ded0cc4608e47c5ba864fc5ab7d 17-Nov-2014 Marco Nelissen <marcone@google.com> am 55f71bc0: Merge "Replace IInterface::asBinder() with a static"

* commit '55f71bc0800b9ec7a779c5d30d5a90e074c2526b':
Replace IInterface::asBinder() with a static
097ca275f4717a2c47a5d49f302ed2b72c8a1370 14-Nov-2014 Marco Nelissen <marcone@google.com> Replace IInterface::asBinder() with a static

so we can do NULL checks again, and update calls to IInterface::asBinder()
to use the new static version.

Change-Id: Ia7b10eb38ca55b72278bfd33d3bf647f338b4e6a
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
8dc55396fc9bc425b5e2c82e76a38080f2a655ff 04-Nov-2014 Dan Stoza <stoza@google.com> Add a BufferItem parameter to onFrameAvailable

Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents. Also
adds an onFrameReplaced callback, which is necessary if the consumer
wants to do anything more than simple queue length tracking.

Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
99b18b447dec188bcec37b415603b9dd400fc7e1 28-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Add StreamSplitter

Adds a StreamSplitter class, that takes one IGraphicBufferConsumer
interface and multiple IGraphicBufferProducer interfaces and
implements a one-to-many broadcast of GraphicBuffers (while managing
fences correctly).

Change-Id: I38ecdf3e311ac521bc781c30dde0cc382a4376a3
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
fd34b65f717b84fa06d8c37f41b070f41d0ad3a3 11-Apr-2014 Dan Stoza <stoza@google.com> Merge "BufferQueue: Add producer buffer-released callback"
b3d0bdf0dbc19f0a0d7d924693025371e24828fd 08-Apr-2014 Dan Stoza <stoza@google.com> BufferQueue: Remove Bn version of create*

It turns out that there's no reason to have both I* and Bn* versions
of the createBufferQueue method, so I removed the Bn* version.

Change-Id: I66aeb09e10458ae540ddf1f38d2d0154ea8f315b
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
f0eaf25e9247edf4d124bedaeb863f7abdf35a3e 21-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Add producer buffer-released callback

Add a callback to the producer side, onBufferReleased, which will be
called every time the consumer releases a buffer back to the
BufferQueue. This will enable a buffer stream splitter to work
autonomously without having to block on dequeueBuffer.

The binder object used for the callback replaces the generic IBinder
token that was passed into IGraphicBufferProducer::connect to detect
the death of the producer. If a producer does not wish to listen for
buffer release events, it can pass in an instance of the
DummyProducerListener class defined in IProducerListener.h, if it even
cares about death events (BufferQueue doesn't enforce the token being
non-NULL, though perhaps we should).

Change-Id: I23935760673524abeafea2b58dccc3583b368710
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
1a0b8617909c94f6c7301b651cb7b07463529c8c 20-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Test remote producer and consumer

Adds a test that puts the BufferQueue into its own process and
connects to it over remote binder interfaces. This exposed the fact
that while IGBC was technically binderized, it didn't actually work
when flattened, so this change also fixes that.

Change-Id: I728cdb662a4273ddd3440ed6040a12560313fe68
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
49bfda1fbdf828a8ea63ae2c2fa25739f6e48527 13-Mar-2014 Jesse Hall <jessehall@google.com> Fix broken build for more tests

Change-Id: I7bdd12a833233724805d01d993541ee05caa9bf6
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
9f3053de78630815d60cf48a2cf2348cc5867c45 07-Mar-2014 Dan Stoza <stoza@google.com> BufferQueue: Allow detaching/reattaching buffers

Adds detachBuffer and attachBuffer calls to both the producer and
consumer sides of BufferQueue. Buffers may be detached while dequeued
by the producer or acquired by the consumer, and when attached, enter
the dequeued and acquired states, respectively.

Bug: 13173343
Change-Id: Ic152692b0a94d99e0135b9bfa62747dab2a54220
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
2e336496c3b3b78910cf1c496e21dc4909ee32ad 06-Mar-2014 Andy McFadden <fadden@android.com> FramebufferNativeWindow.h is obsolete

This adds a deprecation #warning to the header.

Change-Id: Ia32f16e491cb01d435ec8846dda3d9a7d1a9cfc5
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
7ea777f097784492f880623067becac1b276f884 19-Nov-2013 Igor Murashkin <iam@google.com> gui: Add tests for IGraphicBufferProducer

* Basic tests only. Needs more complicated queue/dequeue tests.
* Also needs consumer-side tests to really be thorough.

Change-Id: I1099dd56d65b6e9dfa15377726d6054ce657c0ca
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
799f51268006f319f6ae538dca670bfc7f522688 18-Sep-2013 Mathias Agopian <mathias@google.com> Fix build (tests)

Change-Id: I5b233ef448e5e7eec3818c6586dfea138b28f7b6
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
8b308ed70ed782f68c8075aac2a6b66bbfcdb9af 19-Aug-2013 Andy McFadden <fadden@android.com> Fix build

Neglected the "checkbuild"-built tests.

Change-Id: I202692f1a6d1e306c88e820c959d07d16e7c6a00
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
a4e19521ac4563f2ff6517bcfd63d9b8d33a6d0b 01-Aug-2013 Mathias Agopian <mathias@google.com> Binderize the consumer side of BufferQueue

While currently untested, this should allow to move the
BuffereQueue in the consumer process and have everything
work as usual.

Bug: 9265647

Change-Id: I9ca8f099f7c65b9a27b7e7a3643b46d1b58eacfc
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
7cdd786fa80cf03551291ae8feca7b77583be1c5 19-Jul-2013 Mathias Agopian <mathias@google.com> Make ANW.setSwapInterval(0) work again

we can now queue/dequeue a buffer in asynchrnous mode by using the
async parameter to these calls. async mode is only specified
with those calls (it is not modal anymore).

as a consequence it can only be specified when the buffer count
is not overidden, as error is returned otherwise.

Change-Id: Ic63f4f96f671cb9d65c4cecbcc192615e09a8b6b
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
595264f1af12e25dce57d7c5b1d52ed86ac0d0c9 17-Jul-2013 Mathias Agopian <mathias@google.com> BufferQueue improvements and APIs changes

this is the first step of a series of improvements to
BufferQueue. A few things happen in this change:

- setSynchronousMode() goes away as well as the SynchronousModeAllowed flag
- BufferQueue now defaults to (what used to be) synchronous mode
- a new "controlled by app" flag is passed when creating consumers and producers
those flags are used to put the BufferQueue in a mode where it
will never block if both flags are set. This is achieved by:
- returning an error from dequeueBuffer() if it would block
- making sure a buffer is always available by replacing
the previous buffer with the new one in queueBuffer()
(note: this is similar to what asynchrnous mode used to be)

Note: in this change EGL's swap-interval 0 is broken; this will be
fixed in another change.

Change-Id: I691f9507d6e2e158287e3039f2a79a4d4434211d
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
1585c4d9fbbba3ba70ae625923b85cd02cb8a0fd 28-Jun-2013 Andy McFadden <fadden@android.com> Pay attention to buffer timestamps

When acquiring a buffer, SurfaceFlinger now computes the expected
presentation time and passes it to the BufferQueue acquireBuffer()
method. If it's not yet time to display the buffer, acquireBuffer()
returns PRESENT_LATER instead of a buffer.

The current implementation of the expected-present-time computation
uses approximations and guesswork.

Bug 7900302

Change-Id: If9345611c5983a11a811935aaf27d6388a5036f1
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
4c00cc11141da7d159eb2323b186ed344115c0f1 16-Mar-2013 Jesse Hall <jessehall@google.com> Fix argument types in IGraphicBufferProducer methods

Bug: 8384764
Change-Id: I7a3f1e1a0584a70af04f9eafef900505389d2202
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
1df8c345854155cbbcb9f80de9d12d66ea70ac08 20-Dec-2012 Jamie Gennis <jgennis@google.com> libgui: disallow NULL Fence pointers

This change eliminates the uses of a NULL sp<Fence> indicating that no waiting
is required. Instead we use a non-NULL but invalid Fence object for which the
wait methods will return immediately.

Bug: 7892871
Change-Id: I5360aebe3090422ef6920d56c99fc4eedc642e48
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
2adaf04fab35cf47c824d74d901b54094e01ccd3 18-Dec-2012 Andy McFadden <fadden@android.com> Rename ISurfaceTexture and SurfaceTexture

The C++ class names don't match what the classes do, so rename
ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to
GLConsumer.

Bug 7736700

Change-Id: Ia03e468888025b5cae3c0ee1995434515dbea387
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
c68f2ecfa02037144d1a3856f637a77f523cf416 31-Aug-2012 Jamie Gennis <jgennis@google.com> BufferQueue: add a setMaxAcquiredBufferCount check

This change adds a check to verify the validity of the value passed to
setMaxAcquiredBufferCount.

Change-Id: I39730557aa58261e678bd6e4fce11bab78e98362
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp
9e75ddda93888755d0b14144b62e896cd9f78f3a 01-Sep-2012 Jamie Gennis <jgennis@google.com> libgui: add BufferQueue test infrastructure

This change adds some infrastructure for testing the BufferQueue class. It
also includes a test that tests the new check in BufferQueue::acquireBuffer
that prevents the consumer from acquiring more than one buffer beyond the max
acquired buffer count that was set.

Change-Id: I38554ad3f9a53d2ddeba7ef0deee35ec2e2f9775
/frameworks/native/libs/gui/tests/BufferQueue_test.cpp