4373 Commits

Author SHA1 Message Date
Chris Craik
7a9328a311 Merge "Add temporary functor lifetime logging" into jb-dev 2012-05-22 14:39:13 -07:00
Romain Guy
e5a4a3dc16 Merge "Ensure we always set the proper blending mode Bug #6527305" into jb-dev 2012-05-22 14:28:58 -07:00
Chris Craik
f8dafa14e0 Add temporary functor lifetime logging
bug:6535911

Change-Id: Ida5cc1def7fe1fc314317bbc5df50e1465753deb
2012-05-22 14:26:15 -07:00
Romain Guy
ddf7437361 Ensure we always set the proper blending mode
Bug #6527305

At the beginning of a frame, always set the blending mode that we
think GL is using just in case it was modified by another entity
(for instance a WebView functor.)

Change-Id: I0e1d0abee8a2abb2b8e7622aed28346e89562c06
2012-05-22 14:08:10 -07:00
Chris Craik
c8538ade8d Don't clear the functor at every draw
instead clear functors at invoke time, and let them detach themselves as needed.

bug:6511995
Change-Id: I9115fcadffb27eb850c1d1773c098d3d2e22788b
2012-05-22 11:54:06 -07:00
Romain Guy
f26c8be01b Sanitize display list properties
The comparisons used in the various properties setters could fail badly
in some specific conditions. The scale properties in particular did not
use the same comparisons.

This change also clamps alpha to the 0..1 range which avoids overflow
issues with lowp registers in GLSL computations.

Change-Id: I3e73b584e907a14e2c33d0865ca0d2d4d5bff31d
2012-05-18 10:58:45 -07:00
Romain Guy
49c5fc0b9e Avoid unnecessary copy when invoking drawBitmap(int[])
Bug #6483390

Change-Id: I4d2d725ef50c9401b4bd998b6160128102b40745
2012-05-15 11:15:24 -07:00
Romain Guy
7b8523aaed Merge "Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...)" into jb-dev 2012-05-14 20:12:09 -07:00
Romain Guy
e651cc6239 Remove all Dalvik allocations from Cavnas.drawBitmap(int[], ...)
Change-Id: Ie28538a2104d21154fdc78a56525e7403f08287d
2012-05-14 19:44:40 -07:00
Jeff Brown
e4db99cf87 Merge "Detect when pointer has stopped moving." into jb-dev 2012-05-14 19:18:15 -07:00
Jeff Brown
08b544c7be Merge "Fix pointer indexing issue in VelocityTracker." into jb-dev 2012-05-14 19:17:48 -07:00
Jeff Brown
90729403d5 Detect when pointer has stopped moving.
Some input devices do not generate ACTION_MOVE events while all
pointers have stopped, thereby lulling the VelocityTracker into
a false sense of complacency.  Before handling the following sample,
reset the VelocityTracker state so as not to be influenced by
earlier samples before the pointer stopped.  The velocity after
stopping is assumed to be discontinuous.

Bug: 6413587
Change-Id: I6387bc036ff141d083d3d17a89e37eeaa3188349
2012-05-14 18:57:05 -07:00
Jeff Brown
47a4a50df0 Merge "Improve touch event resampling." into jb-dev 2012-05-14 18:52:59 -07:00
Jeff Brown
dcab190bd2 Fix pointer indexing issue in VelocityTracker.
VelocityTracker was implicitly assuming that the pointer ids in
a MotionEvent were ordered.  That is not necessarily the case
so we need to be careful while copying the pointer coordinates out.

Bug: 6413587
Change-Id: I3b23a954f893eebdf786f2a94207149b092ef036
2012-05-14 18:44:17 -07:00
Jeff Brown
7174a491bc Improve touch event resampling.
Fixed a few bugs related to the id-to-index mapping for
pointer coordinates.

Tightened the bounds on the resampling time interval to
avoid predicting too far into the future.

Only lerp X and Y components of motion events.

Alter the future to satisfy past predictions.  (Rewrite touch
events to conceal obvious discontinuities.)

Added a system property to control whether resampling is enabled
for debugging purposes.

Bug: 6375101
Change-Id: I35972d63278bc4e78148053a4125ad9abeebfedb
2012-05-14 18:31:53 -07:00
Jeff Brown
00ff47484f Merge "More VelocityTracker refactoring." into jb-dev 2012-05-14 17:12:32 -07:00
Romain Guy
99a6ddd4cd Forget the name of a texture after freeing
Bug #6408362

FontRenderer allocates large font textures when more room is needed
to store all the glyphs used by an application. Thse large textures
are the first to be freed when memory needs to be reclaimed by the
system. When freeing a texture, the renderer would however not set
the texture name to an invalid name, leading future allocations to
be performed on the same texture name. That name could have by then
be recycled by the driver and returned by a call to glGenTexture
and used to create an entirely different texture. This would cause
the font renderer to point to the wrong texture, thus leading to
the "corruptions."

Change-Id: I8a1e80e5b79e8f21d1baf5320c090df4f2066cd4
2012-05-14 15:32:18 -07:00
Romain Guy
9d9758ae30 Fix two memory leaks
Bug #6408362

Change-Id: I58543938e7b64d83504e11e97b0dd21ef8ebf3b6
2012-05-14 15:19:58 -07:00
Romain Guy
ae91c4cbc7 Properly pre-cache latin glyphs
Bug #6408362

Change-Id: Ie11644c5a9e2d87d3b851b7e619e5f04b60a7e02
2012-05-14 14:06:02 -07:00
Jeff Brown
85bd0d6283 More VelocityTracker refactoring.
Bug: 6413587
Change-Id: Ida1152e7a34d5fe5caab5e6b5e1bc79f6c7a25e6
2012-05-13 16:10:57 -07:00
Romain Guy
dfa1046eca Add call sites for OpenGL's debug label extension
Change-Id: I9c689127e8166cbef92c935f8aa07217ab806dda
2012-05-12 16:22:35 -07:00
Jeff Brown
8a90e6e317 Minor refactoring before starting on velocity tracker changes.
Bug: 6413587
Change-Id: I5eba2bb57193bff78cb3740de5f87aca0b31d154
2012-05-11 12:32:56 -07:00
Chris Craik
aa9972943c Merge "Revert "Add temporary functor lifetime logging"" into jb-dev 2012-05-08 13:35:09 -07:00
Chris Craik
12d434a9be Revert "Add temporary functor lifetime logging"
bug:6445573

This reverts commit 2fe99801e81bb7c0ff846b536cbb7a12707410ed
2012-05-08 13:07:13 -07:00
Chet Haase
4bbcae7eb8 Merge "Fix issue where scale-animating text would jump temporarily a few pixels" into jb-dev 2012-05-07 13:20:00 -07:00
Chet Haase
d3efd6920e Fix issue where scale-animating text would jump temporarily a few pixels
Some logic in the native matrix code would determine that a matrix was
'pureTranslate' based on the scale values of a matrix being close-enough to 1,
which was within a very small epsilon. This works in general, because screen space
coordinates make that epsilon value irrelevant, so close-enough really is close-enough.

However, TextView, when centering text, works in a coordinate system that is quite
huge, with left/right values about 500,000. These numbers multiplied times that small
epsilon value would give a result that was significant, and would cause a miscalculation
of up to 4-5 pixels, causing the snap that we'd see for a couple of frames as the
scale got "close enough" to 1.

The fix is to remove the optimization of "close enough". What we really need the matrix to
do is to identify itself as being translate-only when no scale as been set (which is the
default). For the purposes of that check, it is good enough to simply check the values against
1 directly. Similarly, the bounds-check logic needs to check against 0 and 1 directly.

Issue #6452687: Glitch when changing scale of a view containing text

Change-Id: I167fb45d02201fb879deea0e5a7ca95e38128e17
2012-05-07 12:18:19 -07:00
Chet Haase
d34dd71800 Fix hang/crash in native path code
An optimization for paths is to only create a texture for the original native
Path object, and have all copies of that object use that texture. This works in
most cases, but sometimes that original path object may get destroyed (when the
SDK path object is finalized) while we are still referencing and using that object
in the DisplayList code. This causes undefined errors such as crashes and hanging
as we iterate through the operations of a destroyed (and garbage-filled) path object.

The fix is to use the existing ResourceCache to refcount the original path until
we are done with it.

Issue #6414050 Analytics Dogfood App crashes reliably on Jellybean

Change-Id: I5dbec5c069f7d6a1e68c13424f454976a7d188e9
2012-05-03 11:14:50 -07:00
Chris Craik
2fe99801e8 Add temporary functor lifetime logging
bug:6405861

Note: revert once the above bug is verified fixed

Change-Id: Iae04ec6ffa73a2711f96e128d60011bcb5864b5c
2012-05-02 16:37:24 -07:00
Jeff Brown
0632b35b68 Merge "Improve handling of built-in keyboard." into jb-dev 2012-05-01 18:39:00 -07:00
Jeff Brown
daa3753a04 Improve handling of built-in keyboard.
The window manager policy made some incorrect assumptions about the
meaning of the Configuration.keyboard field.  We need to be more
careful about distinguishing between built-in and external keyboards.

Most of this change is to move the determination of the parts of
the Configuration related to input devices into the WindowManagerService
leveraging new features of the InputManagerService to good effect.

Then we plumb through the flag that indicates whether a device
is internal or external so that we can be more particular about
how the lid switch effects changes to the Configuration.

Bug: 6424373
Change-Id: I36a1c22ade35e578955465a25940a33f227b9763
2012-05-01 16:34:20 -07:00
Chet Haase
6f9ad204cc Fix launcher invisibility bug
There was a bug in the DisplayList code for layers where we would
set the alpha value for a layer only if the alpha were non-1. This works
most of the time (since the value is usually 1 and doesn't need to
be set at all, and if the value is non-1, it is set correctly). But when
the value has been set to a non-1 value, setting alpha back to 1 cannot happen
due to this logic. This caused launcher to have some invisible pages when
returning to Home because those pages previously had an alpha value of 0, and
setting the alpha to 1 had no effect due to this DisplayList code.

The fix is to simply remove the check for non-1 values; we should
always set the alpha value of layers to handle all cases.

Issue #6413892 alpha value is messed up after AlphaAnimation

Change-Id: Ia51acb2eaaf0609ea7189998ed449bdd9ea7e05f
2012-05-01 10:05:13 -07:00
Jeff Brown
ffd6ea4523 Merge "Resample touch events on frame boundaries." into jb-dev 2012-04-27 17:31:50 -07:00
Jeff Brown
771526c88f Resample touch events on frame boundaries.
Bug: 6375101
Change-Id: I8774e366306bb2b6b4e42b913525bf25b0380ec3
2012-04-27 15:58:42 -07:00
Romain Guy
665a376d24 Merge "Work-around for a Skia rasterization bug Bug #6411457" into jb-dev 2012-04-27 15:20:04 -07:00
Romain Guy
fdd6fc1beb Work-around for a Skia rasterization bug
Bug #6411457

Skia does not generates the bottom right pixel of a rect when
drawing a rect as an SkPath into an alpha8 bitmap.

Change-Id: Ifb5286ae67745c9e44ee387b6d6ad607a9a2e6ce
2012-04-27 11:47:13 -07:00
Romain Guy
8bd12ea800 Merge "Decode common GL error codes when logging frame error status" into jb-dev 2012-04-26 14:06:41 -07:00
Romain Guy
a44a63ac5c Decode common GL error codes when logging frame error status
Change-Id: I38b333eea53aef20340ce48dfcb0dd30a223f7a8
2012-04-26 14:05:02 -07:00
John Reck
a75fbc3c76 Merge "On new content, attach functor directly" into jb-dev 2012-04-26 12:27:56 -07:00
Romain Guy
c189ef5322 Ensure we start every frame in the proper GL state
Bug #6345013, #6314960

Change-Id: I6985f7f233eb6a5f9223e9f4be3f323154b5dbf0
2012-04-25 20:02:53 -07:00
Chris Craik
c2c9543c13 On new content, attach functor directly
bug:6323847

depends on external/webkit change: https://android-git.corp.google.com/g/#/c/184314/

Change-Id: Ibdf997f3ee4f5c5c1ea5a320556813f175fea93f
2012-04-25 15:42:59 -07:00
Romain Guy
3d745c03ac Fix the build before the bot yells at me.
Change-Id: Ice7fe02b684ad662262aae3cac7a48a835ebcad5
2012-04-23 20:36:17 -07:00
Romain Guy
ba6be8a62d Prevent WebView from crashing when detached from the window
Bug #6365056

WebView enqueues a functor in the hardware renderer to handle
animations and this functor is called at a later time by the
hardware renderer. However, the functor was not removed from
the queue when WebView was removed from the window. This could
cause the hardware renderer to attempt to execute an invalid
functor and lead to a crash.

Change-Id: I9d38e80f3fdc5e29d4d0cdfa1e893c251a954508
2012-04-23 20:29:31 -07:00
Jeff Brown
8bca94ad83 More work on international keyboards.
Changed the English US keymaps to implement a strict US key map
with no additional ALT functions.

Fixed a bug copying the alias in the InputDevice copy constructor.

Added support for end of line comments in KCM and KL files.

Added the German keyboard layout.

Sorted the keys in the keyboard layout files by physical arrangement
to make it easier to maintain them.

Bug: 6110399
Change-Id: If44d83de5b98f2bf0016cbb8e12264387b286aaa
2012-04-23 16:12:32 -07:00
Chet Haase
1271e2cc80 Remove USE_DISPLAY_LIST_PROPERTIES flag
This flag was still hanging around pending any need to disable
DisplayList properties. But things seem stable, so it's time to clean up
and simplify the code.

At the same time, I reduced redundance in DisplayList dimensions. We
used to call drawDisplayList() with width/height parameters that were
used to do a clip reject. This is redundant with the DisplayList properties
that set the bounds of the DisplayList; the left/right and top/bottom properties
represent the same width/height properties formerly used in drawDisplayList().
The new approach is to not pass dimensions to drawDisplayList(), but to
instead pull those dimensions directly from the DisplayList when needed.

Change-Id: I8871beff03b1d4be95f7c6e079c31a71d31e0c56
2012-04-23 11:13:17 -07:00
Jeff Brown
5bbd4b4f5f Get alias for Bluetooth devices.
Bluetooth devices can be renamed by the user.  Make the
input system aware of the user-specified name and transparently
pass it down to applications.  This enables the keyboard
layout picker Settings UI to use device names that are
consistent with what the user set in the Bluetooth UI.

Bug: 6363157
Change-Id: I8eea26ce2c69c2a3f09c8de02e9e847610e0419c
2012-04-20 20:11:12 -07:00
Jeff Brown
9a2bbf680e Improve handling of certain keyboard layout properties.
Automatically choose a default value for the 'number' property
based on the characters that the key can generate.

Don't generate any character when ctrl, alt or meta is
pressed unless the behavior exactly matches the modifier keys
that are pressed.

Simplified the basic keyboard layouts taking into account the
new features.

Bug: 6110399
Change-Id: Ibc0f0b50c2dcf3f962a33ac77c24d2993b77637d
2012-04-18 15:01:57 -07:00
Jeff Brown
4a3862f6b0 Add Dvorak keyboard layout.
Added support for mapping both scan codes and HID usages to
KeyLayoutMap and KeyCharacterMap.  Keyboard overlays can
now influence how key events are mapped to key codes.

Bug: 6110399
Change-Id: I6619fd2d3e1337c55928f89869dbc45b535c7ccf
2012-04-17 18:50:05 -07:00
Jeff Brown
6ec6f79e1a Support loading keyboard layout overlays from resources.
Added the concept of a keyboard layout overlay, which is
a key character map file that has "type OVERLAY".

Added support for loading keyboard layout overlays from
resources dynamically.  The layouts are reloaded whenever they
are changed in the Settings application or an application
is installed.  This is somewhat more aggressive than necessary
so we might want to optimize it later.

Before system-ready, the input system uses just the generic
keyboard layouts that are included on the device system image.
After system-ready, it considers the user's selected keyboard
layout overlay and attempts to load it as necessary.  We need to
wait until system-ready before doing this because we need to
be in a state where it is safe to start applications or access
their resources.

Bug: 6110399
Change-Id: Iae0886d3356649b0d2440aa00910a888cedd8323
2012-04-17 17:56:32 -07:00
Jeff Brown
a47425a13c Add support for input devices that have vibrators.
Added a getVibrator() method to InputDevice which returns a Vibrator
associated with that input device.  Its uses the same API as the
system vibrator which makes it easy for applications to be modified
to use one or the other.

Bug: 6334179
Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
2012-04-13 17:01:15 -07:00
Jeff Brown
882735972e Merge "Notify applications when input devices change." 2012-04-12 18:55:57 -07:00