Needed to build successfully when libc++ is the default STL.
Also fix a missing include. Not sure how this was getting by before.
Probably some transitive include.
Change-Id: Ie96b79e96b4e154d786fbf2d5ae5cf5892608837
If getNativeBuffer() is called on a NULL GraphicBuffer the
static_cast of this from GraphicBuffer* to ANativeWindowBuffer*
will return a small pointer like (ANativeWindowBuffer*)0x10.
This value can propagate past NULL checks until it causes a crash
far away from the original NULL pointer. Crash immediately
instead.
Change-Id: Id614b9eb1484108b3c3c733545309844c4b87532
The gralloc API now provides a way for using lock/unlock with the Android
explicit synchronisation concept. This changes updates the GraphicBuffer class
to also expose this functionality, and updates the Surface class to make use of
in line with the dequeueBuffer/queueBuffer mechanism.
This new behaviour is dependent on GRALLOC_MODULE_API_VERSION_0_3. If the local
gralloc module does not support this then the existing synchronous lock/unlock
mechanism will be used.
Change-Id: I8c3fd9592e0c5400ac9be84450f55a77cc0bbdc5
The gralloc API now provides a way for using lock/unlock with the Android
explicit synchronisation concept. This changes updates the GraphicBuffer class
to also expose this functionality, and updates the Surface class to make use of
in line with the dequeueBuffer/queueBuffer mechanism.
This new behaviour is dependent on GRALLOC_MODULE_API_VERSION_0_3. If the local
gralloc module does not support this then the existing synchronous lock/unlock
mechanism will be used.
Change-Id: I77daa1beb197b63b1c2f281b8414ac4ae4b5b03c
The Fence object was writing a size_t into the binder buffer
in flatten, which changes size if the producer and consumer
are running in a 32-bit and a 64-bit process. Use a uint32_t
instead.
Change-Id: Ifed526513800ce27f9d605101cddd922292cca37
Adds a globally-unique ID (PID + sequence number) to every
GraphicBuffer, which will remain the same while crossing Binder,
even if the underlying handles change.
Change-Id: Ib11330a4c5e99621b82204e0adb31b9a88658426
Add SRGBTest.RenderToSRGBSurface, which validates that passing the
SRGB colorspace attributes to eglCreateWindowSurface actually
results in an SRGB surface by comparing the output values to those
of a standard RGB surface.
Change-Id: I3d5fef8070ed8fa2357ddd1c5fcc849ae3fbd12a
- this implements vec2, vec3, vec4, which are float vectors
of size 2, 3 and 4 respectively.
the code allows easy instantiation of vectors of a different
type via the tvec{2|3|4}<T> template classes.
- this also implements mat4 which is a float 4x4 matrix. the
tmat44<T> template class allows easy instantiation of a
4x4 matrix of a different value_type.
The vector types have some minimal support for the
glsl style swizzled access; for instance:
vec4 u;
vec3 v = u.xyz;
only .x, .xy, .xyz and their .stpq / .rgba equivalent are
supported.
most operators are supported on both vector and matrices:
arithmetic, unary, compound assignment and comparison
(bit-wise operators NOT supported).
- operations available on vectors include:
dot, length, distance, normalize and cross
- operations available on matrices include:
transpose, inverse, trace
- and a few utilities to create matrices:
ortho, frustum, lookAt
Change-Id: I64add89ae90fa78d3f2f59985b63495575378635
Fallout from the Flattenable change, update all its uses.
Additionnaly, fix/tighten size checks when (un)flatten()ing
things.
Removed the assumption by some flattenables (e.g.: Fence)
that the size passed to them would be exact (it can
and will be larger in some cases)
The code in Parcel is a bit complicated so that we don't
have to expose the full implementation (and also to
keep the code smallish).
Change-Id: I0bf1c8aca2a3128491b4f45510bc46667e566dde
- timeout is now 3 seconds instead of 1
- simplifies the API a bit
- allows us to change/tweak this timeout globaly
Bug: 8988871
Change-Id: I8d3c6ec43a372f602fb3f29856710339f86c0ec9
until now it was only used to discard a layer entirely.
we're now reducing the size of the layer if it is still
visible, if possible.
this works for instance when a surfaceView is used and
only the menu bar is displayed over it.
Change-Id: I3f5527c5cd1e69ecc968272c8948f1513ada8c55
- Add fields to CpuConsumer::LockedBuffer for new information
- New lock methods for GraphicBuffer and GraphicBufferMapper for
the format
Bug: 8734880
Change-Id: If31f82c62d64b6942cf4cc6e5715585c03273f12
since the transparent region hint really depends on the
content of the window containing the SurfaceView
(it's calculated by the view hierarchy based on
overlapping views), it makes sense to latch it only when
the content of the window (the app) changes.
This should help fixing drawing artifacts when changing the
layout of a window containing a SurfaceView.
Bug: 8511430
Change-Id: Ic3aa668495293cb4d82a2cd7dcf3b6a337287678
- added a ctor that updates and dumps the stack immediately
- added a "logtag" parameter to dump()
Change-Id: Ie51c256071d282591752243bdb4f68cf9ff8829d
T-junction free regions are useful for rendering regions with various
geometric transformations, and the Region's span-ordered, sorted rect
list supports T-junction free storage without modification.
This approach creates a T-junction free region by splitting each
rectangle that is part of a vertical T-junction. This approach is two
pass (up and down) so that divisions can trickle up/down to other
adjacent spans.
Change-Id: Ifcf5e6fe0034c96b00ef09a4433b2b0fce8f4300
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
This change moves the frame time history tracking code out of Layer and into a
new class called FrameTracker. It also changes the tracking to use signal
timestamps from fences when available for more accurate results.
Change-Id: I323c5f075c58bf86ce363b52af885ad0f6365f2b
error codes are returned in errno, this caused ::waitForwever()
to only wait for 1 second and return improper error code (-1).
needed to help debugging 7316632
Bug: 7316632
Change-Id: Ie144f614a88393393972a3a770c6b4b0581f961a
This adds a line to the "dumpsys SurfaceFlinger" output that shows
build-time configuration values.
Example:
Build configuration: [sf HAS_CONTEXT_PRIORITY] [libui] \
[libgui USE_FENCE_SYNC]
Bug 7206633
Change-Id: Ibe1856b459d34a4be6ee83a4ebfd2807e6cc68a0