Commit Graph

28 Commits

Author SHA1 Message Date
Iliyan Malchev
ec10d231c0 frameworks/base: move ANativeWindow/android_native_buffer_t out
These definitions have been moved to system/core.

Change-Id: I021b6b5f2fd72d538b5ccdcb33860ebd3004d9ad
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:39:54 -07:00
Iliyan Malchev
41abd67302 frameworks/base: make the ANativeWindow query() method const
query() does not modify the object's data, so it needs to be a const method

Change-Id: I67c40a3c865461e6f1cc2193fd2d74286ff6ac8f
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 15:49:40 -07:00
Mathias Agopian
1cd921eab3 Revert "retire android_native_window_t"
this type is still used by partner's source trees.
we will get rid of it in next release's timeframe.

This reverts commit 7b49b976277cb3538242151e7dbd24681ddec73e.
2011-03-30 15:28:21 -07:00
Iliyan Malchev
5cfbdc87d6 retire android_native_window_t
Change-Id: I232c526168e1a93977d1c2d0fa74c8937cdeb23b
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-03-23 16:43:20 -07:00
Eino-Ville Talvala
1d01a12e71 Add support for timestamps into SurfaceTexture.
API addition: The timestamps are represented as nanoseconds from some
arbitrary time point. Like the SurfaceTexture transform matrix, the
timestamp retrieved by getTimestamp is for the last frame sent to the
GL texture using updateTexImage().

Camera HAL change: Expect vendors to set these timestamps using
native_window_set_buffers_timestamp().  For now, they are
autogenerated by SurfaceTextureClient if set_buffers_timestamp() is
never called, but such timing is likely not accurate enough to pass a
CTS test.

bug:3300707

Change-Id: Ife131a0c2a826ac27342e11b8a6c42ff49e1bea7
2011-03-17 13:10:03 -07:00
Jamie Gennis
391bbe2246 ANativeWindow: add query for the concrete type.
This change adds a query to the ANativeWindow interface for getting the
concrete type of the ANativeWindow.

Bug: 4086509
Change-Id: I64aa86d72fbca3b52a98e1fc35608737781a3178
2011-03-14 17:47:11 -07:00
Jamie Gennis
134f042286 ANativeWindow: add queues-to-window-composer check.
This change adds a new 'method' to the ANativeWindow interface to check
whether buffers queued to the window will be sent directly to the system
window compositor.

Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d
Bug: 3495535
2011-03-08 16:49:51 -08:00
Jamie Gennis
9d4d6c101d Add the MIN_UNDEQUEUED_BUFFERS query to ANW.
This change adds a new query to ANativeWindow for getting the minimum
number of buffers that must be left un-dequeued during the steady-state
operation of the ANativeWindow.

Change-Id: Ie8c461fc26b02ecde02ddb4f95bf763662cf1551
Related-Bug: 3356050
2011-02-28 12:24:40 -08:00
Jamie Gennis
68f9127e88 Reset ANativeWindow crop on buffer geometry changes.
This changes the ANativeWindow API and the two implementations to reset
the window's crop rectangle to be uncropped when the window's buffer
geometry is changed.

Bug: 3359604
Change-Id: I64283dc8382ae687787ec0bebe6a5d5b4a0dcd6b
2011-01-28 18:21:54 -08:00
Mathias Agopian
19957553cb fix [2835280] Add support for cancelling buffers to ANativeWindow
There is a new ANativeWindow::cancelBuffer() API that can be used to
cancel any dequeued buffer, BEFORE it's been enqueued. The buffer is
returned to the list of availlable buffers. dequeue and cancel are not
mutually thread safe, they must be called from the same thread or
external synchronization must be used.

Change-Id: I86cc7985bace8b6a93ad2c75d2bef5c3c2cb4d61
2010-10-04 20:10:11 -07:00
Mathias Agopian
b661d66013 fix [2931513] Add support for setting the orientation of an ANativeWindow
Also implement support for cropping.

Change-Id: Iba5888dd242bf2feaac9e9ce26e404c1f404c280
2010-08-24 15:40:50 -07:00
Dianne Hackborn
4b5e91e482 Introduce official public NativeWindow type.
Not yet hooked up to anything in the NDK, but requires renaming
the existing android_native_window_t type everywhere.

Change-Id: Iffee6ea39c93b8b34e20fb69e4d2c7c837e5ea2e
2010-06-30 15:32:04 -07:00
Mathias Agopian
a138f89c5e added the notion of fixed-size buffers
the new native_window_set_buffers_geometry allows
to specify a size and format for all buffers to be
dequeued. the buffer will be scalled to the window's
size.

Change-Id: I2c378b85c88d29cdd827a5f319d5c704d79ba381
2010-05-24 18:26:01 -07:00
Mathias Agopian
f10d7fde03 added native_window_set_buffer_count()
this method can be used to change the number of buffers
associated to a native window. the default is two.

Change-Id: I608b959e6b29d77f95edb23c31dc9b099a758f2f
2010-05-21 14:34:32 -07:00
Jamie Gennis
5e67f87430 Add incStrong and decStrong methods to android_native_{window,buffer}_t.
This change adds the methods necessary to use sp<> to handle refcounting
android_native_window_t and android_native_buffer_t.  The new methods forward
the refcounting operations to the corresponding android_native_base_t
functions.

Change-Id: I7de8e262728e439bc1efdf69374a2a9f6f432ced
2010-05-10 17:33:32 -07:00
Mathias Agopian
cc08e688f5 added setCrop() to android_native_window_t
hooked up the new method up to Surface.cpp
the actual crop is not implemented in SF yet

Change-Id: Ic6e313c98fd880f127a051a0ccc71808bd689751
2010-04-20 13:36:29 -07:00
Mathias Agopian
e156e6478f Add a new connect/disconnect API to android_native_window_t
it's used to keep track of which API owns the surface.

Change-Id: I1021c5905c020efc3c428e561b38189377168b22
2010-03-11 15:05:52 -08:00
Mathias Agopian
37b2a3744c really be more friendly with C 2009-08-17 12:33:20 -07:00
Mathias Agopian
238a66e67b be more friendly with C 2009-08-13 18:27:10 -07:00
Dima Zavin
fae3e73b61 ui: make native_window_set_usage be a static inline
Signed-off-by: Dima Zavin <dima@android.com>
2009-08-13 16:52:24 -07:00
Mathias Agopian
5221271375 second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything." 2009-08-11 23:32:29 -07:00
Fred Quintana
b2fd4665e6 Revert "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."
This reverts commit 8b76a0ac6fbf07254629ed1ea86af014d5abe050.
2009-08-11 20:49:35 -07:00
Mathias Agopian
df37b62c62 SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything.
This change makes SurfaceHolder.setType(GPU) obsolete (it's now ignored).
Added an API to android_native_window_t to allow extending the functionality without ever breaking binary compatibility. This is used to implement the new set_usage() API. This API needs to be called by software renderers because the default is to use usage flags suitable for h/w.
2009-08-11 16:12:56 -07:00
Mathias Agopian
6b1f41004f added NATIVE_WINDOW_FORMAT attribute to android_native_window_t 2009-08-06 16:04:29 -07:00
Mathias Agopian
cb6b904164 fixed some issues with the software renderer when surfaces are made current.
there was several issues:
- when a surface was made non-current, the last frame wasn't shown and the buffer could stay locked
- when a surface was made current the 2nd time, it would not dequeue a new buffer

now, queue/dequeue are done when the surface is made current.

for this to work, a new query() hook had to be added on android_native_window_t, it allows to retrieve some attributes of a window (currently only width and height).
2009-07-30 18:14:56 -07:00
Mathias Agopian
aa8c0ff7a3 get rid off unneeded flags 2009-05-05 18:29:35 -07:00
Mathias Agopian
58a79f4745 move android_native_buffer_t declaration into its own private/ui/android_native_priv.h header, since user code should never have access to it. 2009-05-05 18:21:32 -07:00
Mathias Agopian
7189c0054e move opengl/include/EGL/android_natives.h to include/ui/egl/android_natives.h and don't include it from egl.h
the android_native_ types are just forward declared in egl.h
2009-05-05 18:11:11 -07:00