Commit Graph

1318 Commits

Author SHA1 Message Date
Dianne Hackborn
db05e228a4 resolved conflicts for merge of 05be6d6f to master
Change-Id: Ic6a6c5bb300f6f1d43f9ed550b284282b4f16212
2011-05-09 19:00:59 -07:00
Dianne Hackborn
d97f6b4ef9 am 4907d1d5: am 0c6cbf41: Merge "Better compat mode part one: start scaling windows." into honeycomb-mr2
* commit '4907d1d5e2c7d244b07579b8c52153df69754e85':
  Better compat mode part one: start scaling windows.
2011-05-09 17:10:34 -07:00
Dianne Hackborn
16fe3c2c1f Better compat mode part one: start scaling windows.
First step of improving app screen size compatibility mode.  When
running in compat mode, an application's windows are scaled up on
the screen rather than being small with 1:1 pixels.

Currently we scale the application to fill the entire screen, so
don't use an even pixel scaling.  Though this may have some
negative impact on the appearance (it looks okay to me), it has a
big benefit of allowing us to now treat these apps as normal
full-screens apps and do the normal transition animations as you
move in and out and around in them.

This introduces fun stuff in the input system to take care of
modifying pointer coordinates to account for the app window
surface scaling.  The input dispatcher is told about the scale
that is being applied to each window and, when there is one,
adjusts pointer events appropriately as they are being sent
to the transport.

Also modified is CompatibilityInfo, which has been greatly
simplified to not be so insane and incomprehendible.  It is
now simple -- when constructed it determines if the given app
is compatible with the current screen size and density, and
that is that.

There are new APIs on ActivityManagerService to put applications
that we would traditionally consider compatible with larger screens
in compatibility mode.  This is the start of a facility to have
a UI affordance for a user to switch apps in and out of
compatibility.

To test switching of modes, there is a new variation of the "am"
command to do this: am screen-compat [on|off] [package]

This mode switching has the fundamentals of restarting activities
when it is changed, though the state still needs to be persisted
and the overall mode switch cleaned up.

For the few small apps I have tested, things mostly seem to be
working well.  I know of one problem with the text selection
handles being drawn at the wrong position because at some point
the window offset is being scaled incorrectly.  There are
probably other similar issues around the interaction between
two windows because the different window coordinate spaces are
done in a hacky way instead of being formally integrated into
the window manager layout process.

Change-Id: Ie038e3746b448135117bd860859d74e360938557
2011-05-09 17:03:24 -07:00
Iliyan Malchev
697526bc9e frameworks/base: android_native_buffer_t -> ANativeWindowBuffer
Change-Id: Idc2eabaa805bb6d308ebb315872623f28d428417
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-05-03 16:40:14 -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
Jamie Gennis
39a01c6694 Merge "libgui: enable tests in the 'tests' build." 2011-04-28 15:03:56 -07:00
Mathias Agopian
cc57d6f883 Fix uninitialized variable in SurfaceTexture
Change-Id: Ie77cdad481fc0522ff5ea3b7e14ce94e07150793
2011-04-27 18:58:46 -07:00
Mathias Agopian
0ea7d61fa1 Merge "Report errors when eglCreateImageKHR fails" 2011-04-26 18:05:23 -07:00
Jamie Gennis
7fcb077c55 libgui: enable tests in the 'tests' build.
This change makes the libgui makefile recurse into the tests directory
so that the tests get built by a top-level make when
TARGET_BUILD_VARIANT=tests.

Change-Id: I6f623cc4b86dfeb00b9d21823316dbd9def23110
2011-04-26 17:26:37 -07:00
Mathias Agopian
3cd5a11708 Report errors when eglCreateImageKHR fails
Change-Id: Ica39b72ac2505675e619ef4994bd67b98bf6e7da
2011-04-26 15:03:27 -07:00
Kenny Root
7e002d9a3f am fbb0e9f9: am bb93dad9: am bb10986c: am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit 'fbb0e9f9846e185ba8ded63d754c4e61b1499b90':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 12:46:04 -07:00
Kenny Root
f3faf0bc3d am bb93dad9: am bb10986c: am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit 'bb93dad9250c0ee8330ab37bbdcd2eb8bfc0f930':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 11:45:46 -07:00
Kenny Root
b5e7f05190 am 13ce221e: Merge "libutils: Fix an improper const-cast in RefBase"
* commit '13ce221e4316f7956ba072e774a7b97646e5d99b':
  libutils: Fix an improper const-cast in RefBase
2011-04-26 11:32:22 -07:00
Jamie Gennis
1b528fb9d8 EGL: Allow creating a SurfaceTexture EGLSurface.
This change removes the check that disallowed the creation of an
EGLSurface that would send frames to a SurfaceTexture.

Change-Id: I44c6d5df503cc676a88144d72d39b414692ce4c9
2011-04-25 16:41:11 -07:00
Jamie Gennis
fc850124b3 libgui: Fix the tests so they build.
Change-Id: I7205b0819e5801ac549109ff562c3ab1b113d176
2011-04-25 16:40:05 -07:00
Josh Stone
e6b21626a5 libutils: Fix an improper const-cast in RefBase
Under Fedora 15 Beta, gcc 4.6.0 warns:

  frameworks/base/libs/utils/RefBase.cpp: In member function
    ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
  frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing
    ‘const android::RefBase::weakref_impl’ as ‘this’ argument of
    ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’
    discards qualifiers [-fpermissive]

trackMe is not a const function, so don't use const in the static_cast
to a weakref_impl pointer.

Change-Id: I3c9ba73eb127985f5f54197ffecf2939c50f632c
2011-04-22 11:13:35 -07:00
Mathias Agopian
f79f84f8be Merge "Get rid of the "pid" parameter from createSurface" 2011-04-21 17:14:18 -07:00
Evgeniy Stepanov
d547432f98 Make sure binder ioctl structs don't contain uninitialized values.
Change-Id: I8a678f91262417bb120e65e32c244ce1512b46c2
2011-04-21 14:37:15 +04:00
Mathias Agopian
0ef4e15a6c Get rid of the "pid" parameter from createSurface
Change-Id: I28635e3f803e6abe965d79998e305f54a202465d
2011-04-20 14:26:11 -07:00
Jeff Brown
96dfedc55c Merge "Initial checkin of spot presentation for touchpad gestures." 2011-04-19 15:37:32 -07:00
Jeff Brown
4815f2a6ad Initial checkin of spot presentation for touchpad gestures.
Added a new PointerIcon API (hidden for now) for loading
pointer icons.

Fixed a starvation problem in the native Looper's sendMessage
implementation which caused new messages to be posted ahead
of old messages sent with sendMessageDelayed.

Redesigned the touch pad gestures to be defined in terms of
more fluid finger / spot movements.  The objective is to reinforce
the natural mapping between fingers and spots which means there
must not be any discontinuities in spot motion relative to
the fingers.

Removed the SpotController stub and folded its responsibilities
into PointerController.

Change-Id: I5126b1e69d95252fda7f2a684c9287e239a57163
2011-04-19 15:35:51 -07:00
Mathias Agopian
7e3d7f341a Merge "changes to SurfaceTexture needed for unification with SF" 2011-04-18 19:51:26 -07:00
Andreas Huber
6e9eb7453f Merge "Parcel::appendFrom({const } Parcel *parcel, size_t, size_t)" 2011-04-18 08:12:36 -07:00
Mathias Agopian
a36a302e92 Merge "Fix a GraphicBuffer leak in SurfaceTexture" 2011-04-15 18:15:13 -07:00
Dianne Hackborn
97e2bcd760 Rewrite battery history storage.
We now write battery history directly into a buffer, instead of
creating objects.  This allows for more efficient storage; later
it can be even better because we can only write deltas.

The old code is still there temporarily for validation.

Change-Id: I9707d4d8ff30855be8ebdc93bc078911040d8e0b
2011-04-14 10:57:22 -07:00
Andreas Huber
51faf46e29 Parcel::appendFrom({const } Parcel *parcel, size_t, size_t)
As far as I can tell "parcel" isn't actually modified by the implementation.

Change-Id: Ib806eefdc13c97b932773e1dc9ca3a4aad4422b2
2011-04-13 10:21:56 -07:00
Kenny Root
81bc567745 resolved conflicts for merge of 18490fb9 to master
Change-Id: I6c68e6fb0f9c1182a955689bbffc161a8f30bd37
2011-04-12 12:51:08 -07:00
Kenny Root
f6bbefd581 resolved conflicts for merge of 87b3c0dc to honeycomb-plus-aosp
Change-Id: Ia1a0024aabf531438203eb9fea3a10dd15eabe53
2011-04-12 10:27:15 -07:00
Mathias Agopian
7a042bf324 changes to SurfaceTexture needed for unification with SF
- implement connect/disconnect
- implement missing query
- handle texture_2d in addition to texture_external_oes

Change-Id: I971a70821f00f22b01f5337de4a7d451177fec4d
2011-04-11 21:19:55 -07:00
Kenny Root
8a1a615176 am 08d9d9a4: Merge "Runtime resource overlay, iteration 1."
* commit '08d9d9a46250c4fad66e9b637e8898a3524c4286':
  Runtime resource overlay, iteration 1.
2011-04-11 15:33:19 -07:00
Mathias Agopian
4cb18881b5 Fix a GraphicBuffer leak in SurfaceTexture
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
2011-04-08 19:28:04 -07:00
Jeff Brown
76a8686e2b Merge "Coalesce input events that arrive faster than 333Hz." 2011-04-07 13:18:38 -07:00
Jeff Brown
4e394b18ba Coalesce input events that arrive faster than 333Hz.
Some drivers report individual finger updates one at a time
instead of all at once.  When 10 fingers are down, this can
cause the framework to have to handle 10 times as many events
each with 10 times as much data.  Applications like
PointerLocation would get significantly bogged down by all
of the redundant samples.

This change coalesces samples that are closely spaced in time,
before they are dispatched, as part of the motion event batching
protocol.

Increased the size of the InputChannel shared memory buffer so
that applications can catch up faster if they accumulate a
backlog of samples.

Added logging code to help measure input dispatch and drawing
latency issues in the view hierarchy.  See ViewDebug.DEBUG_LATENCY.

Change-Id: Ia5898f781f19901d2225c529a910c32bdf4f504f
2011-04-07 13:11:16 -07:00
Mathias Agopian
b561dd29b5 Merge "remove more unused references to ISurface" 2011-04-06 12:22:29 -07:00
Dianne Hackborn
592e3fc150 Add new resource configurations for screen width/height in "dp".
You can now specify resource configuration variants "wNNNdp"
and "hNNNdp".  These are the minimum screen width/height in "dp"
units.  This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes.  Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted.  To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I22f8afa136b4f274423978c570fa7c9855040496
2011-04-06 11:00:37 -07:00
Mathias Agopian
47d8730a24 remove more unused references to ISurface
Change-Id: I2201f1ca2bb8f203a081d94a0134f798778dfbef
2011-04-05 20:11:55 -07:00
Jeff Brown
884f344137 Merge "Fix dispatcher crash when input monitoring enabled. Also ensure that we actually log assertion failures." 2011-04-01 16:33:40 -07:00
Jeff Brown
23e0c8c1a1 Fix dispatcher crash when input monitoring enabled.
Also ensure that we actually log assertion failures.

Bug: 4203092
Change-Id: I5c14bc41b2255f876858121f5572e2de75cabcc3
2011-04-01 16:15:13 -07:00
Mathias Agopian
a5c75c0162 SurfaceTexture can now force the client to request a buffer
SurfaceTexture now has the concept of default size a new method,
setDefaultBufferSize() to set it. When the default size is
changed, dequeueBuffer() will return a value telling the
client that it must ask for a new buffer.

The above only applies if the client has not
overriden the buffer size with setGeometry.

Change-Id: I520dc40363054b7e37fdb67d6a2e7bce70326e81
2011-04-01 14:43:35 -07:00
Mårten Kongstad
5f29c87ef2 Runtime resource overlay, iteration 1.
Runtime resource overlay allows unmodified applications to appear
as if they had been compiled with additional resources defined. See
libs/utils/README for more information.

This commit is the first iteration of runtime resource overlay. It
provides the actual overlay modifications and loading of trusted overlay
packages (ie residing in /vendor) targeting framework-res.apk.

This commit loads exactly one overlay package. The overlay,
if present, must target framework-res.apk and be located at
/vendor/overlay/framework/framework-res.apk.

Change-Id: If26ee7754813004a96c043dba37fbe99fa3919db
2011-04-01 14:12:10 +02:00
Mathias Agopian
d87f162026 merge libsurfaceflinger_client into libgui
this is the first step in unifying surfacetexture and surface.
for this reason the header files were not moved, as most of them
will eventually go away.

NOTE: currently we keep libsurfaceflinger_client.so as an empty
library to workaround prebuilt binaries wrongly linking against
it.

Change-Id: I130f0de2428e8579033dc41394d093f4e1431a00
2011-03-25 18:42:40 -07:00
Carl Shapiro
3bafffb1bd Include strings.h for the strcasecmp prototype.
Change-Id: I0659ce2186547274e58f8b2027e16d3e45189353
2011-03-21 20:26:25 -07:00
Jeff Brown
f98f1364f8 Merge "Refactor how timeouts are calculated." 2011-03-17 20:16:42 -07:00
Jeff Brown
c0a5e8df03 Refactor how timeouts are calculated.
Added a timeout mechanism to EventHub and InputReader so that
InputMappers can request timeouts to perform delayed processing of
input when needed.

Change-Id: Iec2045baaf4e67690b15eef3c09a58d5cac76897
2011-03-17 17:29:09 -07:00
Eino-Ville Talvala
edc5ac145b Merge "Add support for timestamps into SurfaceTexture." 2011-03-17 15:52:34 -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
Mathias Agopian
939fee8819 am e22aa623: am 25594e19: am f40e638e: fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
* commit 'e22aa62362a3007ee59ac62d4b5969e216987995':
  fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
2011-03-17 00:13:49 -07:00
Mathias Agopian
d0b55c011a fix [4093196] Device lock up - log spam with SharedBufferStack: waitForCondition(LockCondition) timed out
a memory corruption happned when the buffer pool was resized
(like when playing a video or using camera) and there was
no current active buffer. In this case, the faulty code
would index into an array at position -1 which corrupted
24 bytes of data.

also improved region validation code (ifdef'ed out by default)

Bug: 4093196
Change-Id: I915c581d131148959d720e00e3892e9186ab733d
2011-03-17 00:04:42 -07:00
Jeff Brown
e3d4a68f2d Merge "Improve VelocityTracker numerical stability." 2011-03-15 20:01:16 -07:00
Jeff Brown
1593354388 Improve VelocityTracker numerical stability.
Replaced VelocityTracker with a faster and more accurate
native implementation.  This avoids the duplicate maintenance
overhead of having two implementations.

The new algorithm requires that the sample duration be at least
10ms in order to contribute to the velocity calculation.  This
ensures that the velocity is not severely overestimated when
samples arrive in bursts.

The new algorithm computes the exponentially weighted moving
average using weights based on the relative duration of successive
sample periods.

The new algorithm is also more careful about how it handles
individual pointers going down or up and their effects on the
collected movement traces.  The intent is to preserve the last
known velocity of pointers as they go up while also ensuring
that other motion samples do not count twice in that case.

Bug: 4086785
Change-Id: I2632321232c64d6b8faacdb929e33f60e64dcdd3
2011-03-15 19:59:47 -07:00