This is useful in various situations, for instance if the HAL
wants to change its compositing strategy.
Bug: 4488017
Change-Id: I5afc14e5917c6db7926d7417d48677d5aba50caa
This change makes SurfaceFlinger's SurfaceTexture objects default to
async mode whenever a camera or video decoder connects. This behavior
can be disabled by #defining NEVER_DEFAULT_TO_ASYNC_MODE.
Change-Id: I8965951d1775915da180e4af298dd7af3afafecc
This change makes the Layer::onRemoved method call
SurfaceTextures::abandon on the layer's SurfaceTexture. This will cause
all client-initiated operations on the SurfaceTexture to fail. In
particular, this will result in an error on the client side, rather than
a deadlock when removing a layer that used a SurfaceTexture in
synchronous mode.
Change-Id: I14014d00369f29560a21b606831edee432bb8867
Bug: 5020874
This change fixes a bug where the window visibility would be computed
before any buffers were available, causing the window to be treated as
non-opaque. When the first buffer arrived, if both mCurrentOpacity and
the opacity determined by the buffer's format were 'opaque', a
recomputation of the opacity would not be done, and the window would
continue to be treated as non-opaque. SurfaceFlinger could then
unnecessarily draw fully occluded layers.
Change-Id: I2b95da2f4b50e68d50fc5afd8b772e26e62f58d6
Bug: 5057122
- 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
if the state transform didn't preserve rectangles, we
would still try to use h/w composer hal using the bounds
of the transformed rect, which isn't correct.
now we correctly fall back to composition.
Change-Id: Iff78f4339ece415d4987e95a5717b04934d370ab
- surfaceflinger now uses the GL-convention of
placing the origin in the left-bottom corner
- map texture coordinates of the screen capture
properly
- add the ability to control the animation
speed through a debug property
Bug: 4989276
Change-Id: Ifb3297bb578078b47146fff666c01f85417e0d6f
- renderscript now calls EGL directly instead of relying on this function
- surfaceflinger also does its own EGLConfig selection
- selectConfigForPixelFormat stays for legacy reason (many tests use it) but
it now only tries to match the alpha channel of the format rather than the
format itself.
this will allow implementations who don't support the exact formats
defined in the HAL to work properly.
Bug: 4998223
Change-Id: Ic664dfc14d5072a514b6f77a115d1521bfc1578f
This is intended to absorb the cost of the IPC
to the permission controller.
Cached permission checks cost about 3us, while
full blown ones are two orders of magnitude slower.
CAVEAT: PermissionCache can only handle system
permissions safely for now, because the cache is
not purged upon global permission changes.
Change-Id: I8b8a5e71e191e3c01e8f792f253c379190eee62e
This change alters the conditions under which the onFrameAvailable
callback gets called by the C++ SurfaceTexture class. The new behavior
is to call the callback whenever a frame gets queued that will be
visible to the buffer consumer. This means that buffers queued in
synchronous mode always trigger the callback, as those buffers will
remain pending until they are consumed. Buffers queued in asynchronous
mode will only trigger the callback if there was not previously an
unconsumed buffer pending.
The new behavior means that a consumer should perform a draw operation
exactly once for every onFrameAvailable call that it recieves. This
change also modifies SurfaceFlinger and the SurfaceTexture JNI to
support of the new behavior.
Change-Id: I8b2c6e00961d3d58b11c6af50b555b6e4c5f5b40
Add the concept of synchronous dequeueBuffer in SurfaceTexture
Implement {Surface|SurfaceTextureClient}::setSwapInterval()
Add SurfaceTexture logging
fix onFrameAvailable
This change makes SurfaceFlinger unfreeze a window if it ever gets a
buffer that is fixed-size. Normally the window would not be frozen if
its in fixed-size mode, but if the window was frozen before entering
fixed-size mode then it should be unfrozen.
Change-Id: I6bc822d4b02ae51fa8914c1f60f5d24b2002b38d
The transaction flags were atomically read-and-cleared to determine if
a transaction was needed, in the later case, mStateLock was taken to
keep the current state still during the transaction. This left a small
window open, where a layer could be removed after the transaction flags
were checked but before the transaction was started holding the lock.
In that situation eTraversalNeeded would be set but only seen during the
next transaction cycle; however, because we're handling this transaction
(because of another flag) it will be commited, "loosing" the information
about the layer being removed -- so when the next transaction cycle due
to eTraversalNeeded starts, it won't notice that layers have been removed
and won't populated the ditchedLayers array.
Change-Id: Iedea9e25fee8dd98a0c5bd5ad41a20fcadf75b47
Client::mLayers could be accessed from different threads.
On one side from Client::attachLayer() which is currently
called from a binder thread; on the other side from
Client::detachLayer() which is always called from the main
thread.
This could lead to a corruption of Client::mLayers.
We fix this issue by adding an internal lock to Client.
Change-Id: Ib1317d7750ed5030e6f577efe34b69fc10198bd3
Without that lock, there is a chance of race condition
where while composing a specific index, requestBuf with
the same index can be executed and touch the
same data that is being used in initEglImage.
(e.g. dirty flag in texture)
This leak was intentional, it was there to deal with the fact that
some gralloc implementations don't track buffer handles with
file-descriptors so buffers needed to stay alive until there were
registered, which is not guaranteed by binder transactions.
In this new implementation, we use a small BBinder holding a
reference to the buffer, which with tuck into the parcel. This forces
the reference to stay alive until the parcel is destroyed, which
is guaranteed (by construction) to happen after the buffer is
registered.
this allows the public facing API to not expose the previous hack.
Change-Id: I1dd6cd83679a2b7457ad628169e2851acc027143