we would leak a weakref_impl if a RefBase was never incWeak()'ed.
there was also a dangling pointer that would cause memory corruption
and double-delete when a custom destroyer was used to delay the
execution of ~RefBase.
it turns out that the custom destroyer feature caused most of the
problems, so it's now gone. The only client was SurfaceFlinger
who now handles things on its own.
RefBase is essentially back its "gingerbread" state, but the
code was slightly cleaned-up.
Bug: 5151207, 5084978
Change-Id: Id6ef1d707f96d96366f75068f77b30e0ce2722a5
we now make sure to drain the buffer queue on disconnect.
this happens only when in synchrnous mode. in async mode
we clear all buffers except the head of the queue.
for extra safety we also catch the null pointer
in updateTexImage (which should never happen) and return
an error.
Bug: 5111008
Change-Id: I5174a6ecbb0de641c6510ef56a611cbb4e9e1f59
this simplifies the code a bit and also makes sure
we reevaluate mAbandoned and mConnectedApi each time
we come back from waiting on mDequeueCondition
Change-Id: I1f8538b62ad321b51ed79d953b700036daba796d
- also log a warning when freeAllBuffers is called with a non empty buffer queue
- rename freeAllBuffers to freeAllBuffersLocked
Change-Id: Idb71fdcf233b9ccae62d5a2a7c3c4bad2501d877
This fixes an issue where the Surface readFromParcel code was leaving
unread parcel data in the case where the Surface was re-used from the
sCachedSurfaces cache. On a cache miss the code is creating a new
Surface from the remainder of the parcel data. On a hit that data was
being left unread, so anything that parcels a Surface followed by
additional arguments may end up reading the wrong values.
Change-Id: I25365159d945c125bd1fcc9f17e39a4f00aece55
the first time a surface was connected, the values returned
by query NATIVE_WINDOW_DEFAULT_{WIDTH|HEIGHT} and
NATIVE_WINDOW_TRANSFORM_HINT were wrong until a call
to queueBuffer was performed.
Bug: 5137366, 5121607
Change-Id: I7ac6b5b0daa876638f6bed7c20f286a6e6d984f6
the original connect/disconnect hooks are deprecated
and replace by api_connect/api_disconnect. the original
hooks are no no-ops.
api_connect/api_disconnect is now only called from the
android framework.
Bug: 5057915
Change-Id: I8ca64cd1acd6cabf915bf54689ec2e5f6dfa495a
Bug: 5064702
Introduced the concept of an InputListener to further decouple
the InputReader from the InputDispatcher. The InputListener
exposes just the minimum interface that the InputReader needs
to communicate with the outside world. The InputReader
passes arguments to the InputListener by reference, which makes
it easy to queue them up.
Consolidated all of the InputReader locks into one simple global
Mutex. The reason this wasn't done before was due to potential
re-entrance in outbound calls to the InputDispatcher. To fix this,
the InputReader now queues up all of the events it wants to send
using a QueuedInputListener, then flushes them outside of the
critical section after all of the event processing is finished.
Removing all of the InputMapper locks greatly simplifies the
implementation.
Added tests for new stylus features such as buttons, tool types,
and hovering.
Added some helpers to BitSet32 to handle common code patterns
like finding the first marked bit and clearing it.
Fixed a bug in VelocityTracker where the wrong pointer trace
could get cleared when handling ACTION_POINTER_DOWN. Oops.
Changed PointerCoords so it no longer stores useless zero
axis values. Removed editAxisValue because it is not very
useful when all zero value axes are absent and therefore
cannot be edited in place.
Added dispatch of stylus hover events.
Added support for distance and tool types.
Change-Id: I4cf14d134fcb1db7d10be5f2af7b37deef8f8468
This change relaxes an error check in SurfaceTexture::setBufferCount to
allow clients to explicitly set a buffer count of 2. The clients that
will do this are camera and video decode. Previously it was thought
that for those clients we would always use async mode, which requires a
minimum of 3 buffers. However, we now believe that for some devices it
may make sense to use synchronous mode (with 2 buffers) to reduce memory
usage.
Bug: 5088418
Change-Id: I620a0ef75075745be9d6c8219e0246aaf33ba950
GraphicAllocator debugging cannot deal with
custom HAL formats. make this more obvious in the
log.
Change-Id: I202e58a7f213f32e725aa4eac62cdf6e50ca5894
We should use all-makefiles-under instead.
all-subdir-makefiles can be used only before any "include" statement.
Before this change, both subdirs were actually not included.
Change-Id: I6bf35d07f294a5012c9322096f999ac26e37432f
The built-in ZipFile class was quite a long time to find an unpack
libraries. Move everything to using the libutils ZipFileRO class that
goes quite a bit faster. Initial measurements are 6 times faster than
the Java code.
Also, read files off the disk and compare their CRC against the APK's
CRC to see if we need to write the new file to disk. This also cuts down
the bootup time by up to a second per APK that has native files.
Change-Id: Ic464a7969a17368fb6a6b81d026888c4136c7603
The Surface is already using SurfaceTexture internally and it is parcelable. This
is intended to replace and phase out ParcelSurfaceTexture in favor of creating a
new Surface.java object from an existing SurfaceTexture.
Change-Id: I8e2dd86614523da6abed6403e1d705a68fa19fdf
This change removes support for conditionally using the GL_TEXTURE_2D
target for SurfaceTexture textures with RGB buffers. It also enables
and fixes the RGB-based SurfaceTexture tests.
Change-Id: I9a251a981cf66af6b048b2e4c3fe7231e4774f4d
This change adds the 'abandon' method to the SurfaceTexture C++ class.
This method may be used to put the SurfaceTexture in an abandoned state,
causing all ISurfaceTexture methods to fail.
Change-Id: Ibd261f7b73f44e2bec36a8508bf92113cfb7cf95
This change adds a test to ensure that a GL driver that's blocking on a
call to dequeueBuffer does not block other GL threads from rendering and
queueing buffers.
Change-Id: Ifdd234effc534b6a9cf8522ca87f64da5bb0bbd6
- fixed uninitialized variable
- set hint to indentity when transform is too complex
- make sure FrameBufferNativeWindow doesn't fail on needed perform commands
Bug: 4487161
Change-Id: I7cb2b0869b72404732eca7cb2d145ff669e2ed9b
This change removes the SurfaceTexture::getAllocator method, as it's no
longer needed. Proper refcounting of the Gralloc buffers is now handled
by the IGraphicBufferAlloc binder marshalling code.
Change-Id: I5cffa6ebfc1bc5828fb7ce0e0a5b2f55cd8479da
This makes ANativeWindow_lock/ANativeWindow_unlockAndPost work
with ANativeWindows implemented by Surface and SurfaceTextureClient.
Also, Surface now inherits directly from SurfaceTextureClient.
Bug: 5003724
Change-Id: I9f285877c7bae9a262e9a7af91c2bae78804b2ef