22259 Commits

Author SHA1 Message Date
Selim Gurun
e83b83fe20 Merge "Act on credential storage updates." 2012-02-15 17:48:12 -08:00
Romain Guy
f7280ccbfe Merge "Add a compile time condition to remove unnecessary code" 2012-02-15 16:41:29 -08:00
Romain Guy
fe455af277 Add a compile time condition to remove unnecessary code
Change-Id: Ia44916af8e22e548fbb62cb2b53da285d5959102
2012-02-15 16:40:20 -08:00
Jeff Brown
57ff581bd9 Merge "Keep the display event receiver around forever." 2012-02-15 15:44:14 -08:00
Jeff Brown
1654d0b8d9 Keep the display event receiver around forever.
There is really no point disposing the display event receiver
anymore.  Moreover, it's hard to choose a good time to do it
since the Choreographer only supports one-shot callbacks now.

So let's made the code simpler.

Bug: 5721047
Change-Id: I8533a54e93a787e0ca30d99a1f1eea85534b13b9
2012-02-15 15:40:52 -08:00
Jeff Brown
c4c0a22ae9 Merge "Simplify Choreographer API." 2012-02-15 15:37:49 -08:00
Jeff Brown
4a06c8008b Simplify Choreographer API.
Removed the listeners and schedule animation / draw methods.
Instead all requests are posted as one-shot callbacks, which is a
better match for how clients actually use the Choreographer.

Bug: 5721047
Change-Id: I113180b2713a300e4444d0d987f52b8157b7ac15
2012-02-15 15:06:01 -08:00
Fabrice Di Meglio
54546f22fb Make MarginLayoutParams startMargin and endMargin API public
Change-Id: I519f8ede818b068883ee1565d28e188298af9f0e
2012-02-15 14:54:48 -08:00
Jesse Wilson
3200d086a6 Merge "Implement the (hidden) ExtendedResponseCache interface." 2012-02-15 14:17:55 -08:00
Fabrice Di Meglio
2c884826b2 Make View paddingStart and paddingEnd API public
Change-Id: I39fd987c866e8bfadbaa9a29c0e38b3b7ce03f7e
2012-02-15 13:57:09 -08:00
Jesse Wilson
18c227ba72 Implement the (hidden) ExtendedResponseCache interface.
Bug: http://code.google.com/p/android/issues/detail?id=25418
Change-Id: I4b20d576bac7036f94e57db7124de44f5b8d75be
2012-02-15 16:53:57 -05:00
Romain Guy
cb1abb15a7 Merge "Make it easier to enable dirty regions debugging" 2012-02-15 12:38:05 -08:00
Romain Guy
b04f7e9438 Make it easier to enable dirty regions debugging
adb shell setprop hwui.debug_dirty_regions true

Change-Id: Ifd269c443f5257b1e9c4ea987b134dcf6231106c
2012-02-15 12:36:54 -08:00
Gilles Debunne
8181201c6e Merge "Invalidate display list on alpha change" 2012-02-15 10:23:18 -08:00
Selim Gurun
fcd93b72a3 Act on credential storage updates.
Bug: 6009802

Listen to credential storage updates and clean state when necessary.

Change-Id: I48f2e7d6e036882c2b4a29fbd357ca018fd4e4c7
2012-02-15 10:02:25 -08:00
Steven Ross
71878402dd Merge "Removing dependence on enable_facelock" 2012-02-15 03:29:57 -08:00
Jeff Brown
fef3d62b16 Merge "Add support for posting Runnables to the Choreographer." 2012-02-14 19:41:32 -08:00
Jeff Brown
472ea60685 Merge "Add a barrier mechanism to the MessageQueue." 2012-02-14 19:41:22 -08:00
Jeff Brown
968588573c Add support for posting Runnables to the Choreographer.
Also clean up the Choreographer so that it doesn't directly extend
Handler and so that it doesn't schedule animation or drawing unless
there are listeners or callbacks attached.

Bug: 5721047
Change-Id: I35350c8d41d4fa3f8c8c7bc43edd82e581b55a68
2012-02-14 19:36:12 -08:00
Jeff Brown
e799cb78b4 Add a barrier mechanism to the MessageQueue.
The synchronization barrier enables selectively blocking
execution of synchronous messages until the barrier is released.
Asynchronous messages may continue running in the meantime.

The barrier is intended to be used to implement more sophisticated
scheduling policies related to view hierarchy traversals.  While
traversals are pending, most messages posted to the message queue
must be held up.  This is to satisfy the invariant that traversals
will occur before subsequently posted messages are handled.

The exception to this rule are "asynchronous" messages that represent
external events or interrupts that come from other components such
as VSYNC pulses, input events or sensor events.  Because these messages
are typically delivered at arbitrary times, they are independent of
traversals or other typical synchronization boundaries.

Messages can now be flagged as asynchronous to indicate that they
are weakly ordered.

Bug: 5721047
Change-Id: I1446dcfbc896f33b48355adc28967ace8c8c9b9b
2012-02-14 19:27:15 -08:00
Svetoslav Ganov
b36a0ac970 Incorrect behavior of View clear focus v2.0.
The framework tries to have a focused view all the time. For
that purpose when a view's focus is cleared the focus is given
to the first focusable found from the top. The implementation
of this behavior was causing the following issues:

1. If the fist focusable View tries to clear its focus it
   was getting focus but the onFocusChange callbacks were not
   properly invoked. Specifically, the onFocusChange for
   gaining focus was called first and then the same
   callback for clearing focus. Note that the callback
   for clearing focus is called when the View is already
   focused.

2. If not the first focusable View tries to clear focus,
   the focus is given to another one but the callback
   for getting focus was called before the one for clearing,
   so client code may be mislead that there is more than
   one focused view at a time.

3. (Nit) The implementaion of clearFocus and unFocus in ViewGroup
   was calling the super implementaion when there is a
   focused child. Since there could be only one focused View,
   having a focused child means that the group is not focused
   and the call to the super implementation is not needed.

4. Added unit tests that verify the correct behavior, i.e.
   the focus of the first focused view cannot be cleared
   which means that no focus change callbacks are invoked.
   The callbacks should be called in expected order.
   Now the view focus clear precedes the view focus gain
   callback. However, in between is invoked the global
   focus change callback with the correct values. We may
   want to call that one after the View callbacks. If
   needed we can revisit this.

Change-Id: I8cfb141c948141703093cf6fa2037be60861cee0
2012-02-14 17:50:51 -08:00
Gilles Debunne
5e78d9bea5 Invalidate display list on alpha change
Bug 5945886

Change-Id: Ibab3ad2c9e526c038672699b571de154dfc8d17c
2012-02-14 17:46:43 -08:00
Chris Craik
d658c024ea Merge "disable webkit paint pausing" 2012-02-14 15:56:08 -08:00
Amith Yamasani
dd29f8c4e3 Merge "Revert "Incorrect behavior of View clear focus."" 2012-02-14 15:52:17 -08:00
Gilles Debunne
626c316975 Display list invalidated on hint text change
Bug 5993119

Change-Id: I750e73cb5c26e2aaa2a88a80cf35c4d471c30403
2012-02-14 15:46:43 -08:00
Amith Yamasani
73eb97f628 Revert "Incorrect behavior of View clear focus."
This reverts commit c6fd88e213703a581fe4680259981f09ae0444f2
2012-02-14 15:45:15 -08:00
Chris Craik
644b7d95f0 disable webkit paint pausing
Temporary measure for investigating potentially related bug:5964385

Change-Id: I6eb0ba25991bdf7eab506b51a9eae71e9ddd436b
2012-02-14 15:29:39 -08:00
Fabrice Di Meglio
d7c845c39a Merge "Make textDirection API public" 2012-02-14 14:45:51 -08:00
Gilles Debunne
43db1d9c47 Merge "Minor typo fixes" 2012-02-14 14:41:15 -08:00
Teng-Hui Zhu
728f1ed5e3 Merge "Update the scale while updating the drawGL functor" 2012-02-14 12:51:19 -08:00
Teng-Hui Zhu
7e2346d51a Update the scale while updating the drawGL functor
bug:6008955

webkit change:
https://android-git.corp.google.com/g/#/c/165734/

Change-Id: I5ba7998a6b8f33b44582b0158ba966054aaad2a8
2012-02-14 11:29:52 -08:00
Chet Haase
bcca79acb1 Refactor animation code in new Draw() method into its own method.
Ongoing cleanup of View drawing code, continuation of drawChild() refactoring.

Change-Id: I6d7383bb858d39ced6917d559defe7713e53de38
2012-02-14 09:16:39 -08:00
Steven Ross
c9237f41a4 Removing dependence on enable_facelock
With this change, FaceUnlock is enabled by default when installed
fixes 5989485

Change-Id: Icbce3237ff533e8b7b88faf592ac4a1e143d5dc3
2012-02-14 09:27:00 -05:00
Chet Haase
4212d3fc73 Merge "Refactor ViewGroup.drawChild() into View.draw()" 2012-02-14 06:20:16 -08:00
Jeff Brown
a9daa164a5 Merge "Fix possible races in vsync infrastructure." 2012-02-13 20:38:24 -08:00
Jeff Brown
58aedbc9be Fix possible races in vsync infrastructure.
Applications sometimes crashed on exit due to the display event
receiver pipe apparently being closed while still a member of the
Looper's epoll fd set.

This patch fixes a few different possible races related to
the display event receiver lifecycle.

1. The receiver used to play a little dance with the Looper,
registering and unregistering its callback after each vsync
request.  This code was a holdover from a time before the
surface flinger supported one-shot vsync requests, so we can
get rid of it and make things a lot simpler.

2. When the Choreographer is being accessed from outside the UI
thread, it needs to take great care that it does not touch
the display event receiver.  Bad things could happen if the receiver
is handling a vsync event on the Looper and the receiver is
disposed concurrently.

3. It was possible for the Choreographer to attempt to dispose
the receiver while handling a vsync message.  Now we defer disposing
the receiver for a little while, which is also nice because we
may be able to avoid disposing the receiver altogether if we find
that we need it again a little while later.

Bug: 5974105
Change-Id: I77a158f51b0b689af34d07aee4245b969e6260d6
2012-02-13 20:34:38 -08:00
Gilles Debunne
07ba2a2131 Minor typo fixes
Change-Id: I8cd9500cc50b7a484bf387e6a6a0c9b4ffb175a4
2012-02-13 18:13:44 -08:00
Romain Guy
ccdc6a6acc Merge "New debugging tool in adb shell dumpsys gfxinfo" 2012-02-13 18:03:44 -08:00
Romain Guy
a676ad7e34 New debugging tool in adb shell dumpsys gfxinfo
This tool lets you visualize the time it took, in ms, to:
- Build display lists ("Draw" phase)
- Process display lists ("Process" phase)
- Swap GL buffers ("Execute" phase)

To use this tool:
- adb shell setprop hwui.profile true
- adb shell dumpsys gfxinfo <process name>
- Copy the profile data and paste it in a spreadsheet
- Generate a graph (stacked graph) and enjoy

Change-Id: I7840c0ea0f153550425aa798e3ada2f357688cf5
2012-02-13 17:47:10 -08:00
Fabrice Di Meglio
e7beae3f4c Make textDirection API public
Change-Id: I2d5a0e3a990b9a5b78a3bbc8df7f655702743e4b
2012-02-13 17:21:05 -08:00
Philip Milne
94355ed44a Merge "New hooks to allow layouts to improve their performance by doing more caching" 2012-02-13 17:05:01 -08:00
Chet Haase
64a48c1d3d Refactor ViewGroup.drawChild() into View.draw()
Some of the ongoing and upcoming jank work involves having
Views optimize their rendering. For example, it would be more
efficient for native display lists to be able to redraw themselves with
updated transform/alpha properties than it would be to do it the
way we do now, which causes view hierarchy invalidation and display
list recreation.

In order to do this, we need to push more intelligence for view
rendering into the Views themselves, rather than the complicated
mechanism we have now of ViewGroup handling some View properties
(transforms and alpha) and the Views handling the rest of their
rendering.

The first step toward this is to take the current drawChild() method
and push it into a new, package-private method in View that does the
same thing.

Future checkins will refactor the code further, simplifying it and
eventually optimizing around view property changes.

Change-Id: Id44b94536fc3ff80b474db7ef06862f4f51eedce
2012-02-13 17:02:39 -08:00
Philip Milne
d7dd89095f New hooks to allow layouts to improve their performance by doing more caching
This change allows layouts to be notified of changes to LayoutParameters that have occurred
between layout operations.

If an assignment is made to the fields of LayoutParams instances that are already in use,
cachced data may become inconsistent with the new values. For complex layouts, like
GridLayout, in which the layout parameters define the structure of the layout, caching
could have caused  ArrayOutOfBoundsException to be raised without this change. This case is
rare in normal code as initialisation is typically performed once. Its nevertheless possible
and much more likely in environments like design tools where layout parametrs may be being
edited on the fly.

Prevent errors as follows (belt and braces):

1. Change javadoc to request that changes to the fields of LayoutParams be accompanied with
a call to View.setLayoutParams(). (This calls requestLayout() which was what the previous
javadoc advised.) Provide a (for now, private) hook for layouts with caches to receive notification
of such calls so they can invalidate any relevant internal state.

2. For GridLayout, we cannot clone layout parameters as traditional Java grids do without retaining
two complete copies because of the public getLayoutParameters() method on View. Retaining two
copies is wasteful on constrainted devices. Instead, we keep just one copy and compute a hashCode
for the critical fields of a GridLayout's layoutParams. The hashChode is checked it prior to all
layout operations; clearing the cache and logging a warning when changes are detected, so that
developers can fix their code to provide the call to setLayoutParams() as above.

Change-Id: I819ea65ec0ab82202e2f94fd5cd3ae2723c1a9a0
2012-02-13 16:55:57 -08:00
Mangesh Ghiware
7850783b73 Merge "Fix regression in default zoom setting" 2012-02-13 16:47:10 -08:00
Mangesh Ghiware
8d3836c11e Fix regression in default zoom setting
Bug: 6000309
Change-Id: I4255c847c0e7d2a5ab654014f6f4b5d32b5fdf67
2012-02-13 16:20:22 -08:00
Fabrice Di Meglio
7a29d84f01 Merge "Fix bug #5904777 GridLayout should be RTL aware" 2012-02-13 14:01:28 -08:00
Fabrice Di Meglio
47d248eb43 Fix bug #5904777 GridLayout should be RTL aware
- update also DEBUG mode for taking care about RTL
- one minor issue remaining: left alignment is not properly honored in RTL

Change-Id: I9a4c8413cb1189a032649472016994642418637b
2012-02-13 13:52:47 -08:00
Jeff Brown
072ec96a49 Implement batching of input events on the consumer side.
To support this feature, the input dispatcher now allows input
events to be acknowledged out-of-order.  As a result, the
consumer can choose to defer handling an input event from one
device (because it is building a big batch) while continuing
to handle input events from other devices.

The InputEventReceiver now sends a notification when a batch
is pending.  The ViewRoot handles this notification by scheduling
a draw on the next sync.  When the draw happens, the InputEventReceiver
is instructed to consume all pending batched input events, the
input event queue is fully processed (as much as possible),
and then the ViewRoot performs traversals as usual.

With these changes in place, the input dispatch latency is
consistently less than one frame as long as the application itself
isn't stalled.  Input events are delivered to the application
as soon as possible and are handled as soon as possible.  In practice,
it is no longer possible for an application to build up a huge
backlog of touch events.

This is part of a series of changes to improve input system pipelining.

Bug: 5963420

Change-Id: I42c01117eca78f12d66d49a736c1c122346ccd1d
2012-02-13 10:28:41 -08:00
Jeff Brown
d4762334f1 Merge "Process input events immediately when received." 2012-02-13 10:26:40 -08:00
Marc Blank
5a1f6fb407 Merge "Use &#39; for apostrophe in HTML encoding" 2012-02-13 10:20:38 -08:00