2556 Commits

Author SHA1 Message Date
buzbee
b63de6de02 Process new system property for max JIT cache size
To allow low-memory devices to reduce (or eliminate entirely)
the RAM used by the JIT, dalvikvm has a new command-line
option to set the max size of the JIT's translation cache.
In this CL, we pass that new option based on a system property.

Change-Id: I2a01da4d19c1922b6ed52791ee513efef9caf3d4
2013-05-24 13:14:08 -07:00
Anwar Ghuloum
dadfb9c9bf Merge "Add more memory usage stats" 2013-05-23 22:14:34 +00:00
Anwar Ghuloum
27ff7ba394 Merge "More stats for meminfo" 2013-05-23 22:13:52 +00:00
Anwar Ghuloum
9a78222df2 Merge "break out boot.art" 2013-05-23 22:13:28 +00:00
Anwar Ghuloum
17082e0452 Merge "Break out Oat footprint for ram" 2013-05-23 22:13:04 +00:00
Romain Guy
6080940411 Merge "Add PerfHUD ES profiling capabilities" 2013-05-23 19:50:58 +00:00
Romain Guy
e9bc11f712 Add PerfHUD ES profiling capabilities
The eglGetSystemTimeNV extension can be used to enable profiling
in PerfHUD ES. When the delta of two calls to eglGetSystemTimeNV
equals 0, we now cancels display lists updates. This allows the
tool to redraw the same frame several times in a row to run its
analysis.

For better results profiling should only be attempted after
setting viewroot.profile_rendering to true using adb shell
setprop.

Change-Id: I02e3c237418004cff8d6cb0b9a37126efae44c90
2013-05-23 12:50:13 -07:00
Anwar Ghuloum
3c61506b71 Add more memory usage stats
Added support for teasing apart different parts of the dalvik heap.

Note this adds more public api and we should talk to hackbod before going into master with this.

(cherry picked from commit 73407daf3f6110e933d8614605b21586c4c5fde2)

Change-Id: If4431f50e67e18bcc42e00694c97805477bd6815
2013-05-23 12:30:42 -07:00
Anwar Ghuloum
3a8ce1bec8 More stats for meminfo
Added shared clean tracking (for pageable stuff).  Renamed .oat and .art mmap.

(cherry picked from commit 967d53b17b6010c3a675ca9c3bbd0e9dd2f2f092)

Change-Id: I741e0dbe0d3f9aee6975c6fad8af9905942962d4
2013-05-23 12:29:59 -07:00
Anwar Ghuloum
88887d0a53 break out boot.art
breaking out boot.art mapped pages

(cherry picked from commit eaa3f2d59adaeb87cd8d1726b696521f984659c4)

Change-Id: Ie89477bd3a93a15de3a4db76ef5eae497c3087e3
2013-05-23 12:29:37 -07:00
Anwar Ghuloum
8884ef4fe8 Break out Oat footprint for ram
Breaking out oat footprint in meminfo.

(cherry picked from commit c92f177d96b5952e0bfde01597972fc607aed93a)

Change-Id: I7b0452045c265b7544c41d3a5953e10a081c5315
2013-05-23 12:28:08 -07:00
Jeff Brown
4418bed617 am e20fbc6f: am d6619ed8: Merge "Add a queue of pending finished input events." into jb-mr2-dev
* commit 'e20fbc6feb6709c01bf0afdf86a75882c9a0e663':
  Add a queue of pending finished input events.
2013-05-22 15:48:45 -07:00
Jeff Brown
e20fbc6feb am d6619ed8: Merge "Add a queue of pending finished input events." into jb-mr2-dev
* commit 'd6619ed89ff7e10b0b66aadc353cfea171929344':
  Add a queue of pending finished input events.
2013-05-22 15:46:57 -07:00
Geremy Condra
8bae56e278 am 8acde57d: am 1b12ab00: am 9c759e39: Merge "Fix SELinux get.. methods aborting on invalid address"
* commit '8acde57d23d7e85b493d4d9502e834509f1c46ba':
  Fix SELinux get.. methods aborting on invalid address
2013-05-22 13:07:02 -07:00
Geremy Condra
1b12ab0099 am 9c759e39: Merge "Fix SELinux get.. methods aborting on invalid address"
* commit '9c759e3968015c0d30a1a049754e4514adfdb565':
  Fix SELinux get.. methods aborting on invalid address
2013-05-22 13:03:21 -07:00
Jeff Brown
56513492ea Add a queue of pending finished input events.
Although in practice an application or IME is unlikely to fill up
the input channel with finish events, it can happen when events are
being delivered very rapidly.  Handle this situation by queuing
up the pending finish events until the socket becomes writable again.

Bug: 9034301
Change-Id: I938a62a75d12106a19cff2d016ba7af0db877ecf
2013-05-22 10:33:48 -07:00
Richard Haines
81ad284517 Fix SELinux get.. methods aborting on invalid address
SELinux get.. JNI need the 'security_context_t tmp' entries set
to NULL, otherwise on error freecon() tries to release uninitialised
memory causing apps to abort with invalid address.
Also fixed getPeerCon ALOGV call as this caused Zyote to abort when
verbose logging set.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
2013-05-22 15:12:16 +01:00
Chris Craik
41541825bc Use individual glyph positions to determine text bounds.
bug:8766924

Previously text bounds were calculated to be from 0 to totalAdvance in
the X, and from the font's top to bottom. These are incorrect,
especially in light of the font fallback mechanism.

Now, we calculate the bounds of the text as we layout each glyph.
Since these are much tighter bounds in the common case, this
significantly reduces the amount of clipping required (which in turn
enables more aggressive text merging).

Change-Id: I172e5466bf5975bf837af894a9964c41db538746
2013-05-21 23:04:05 +00:00
Romain Guy
4eb3c13261 am 25f6f4f5: am 3c1ad55f: Merge "Update Canvas.getClipBounds to not account for AA clips." into jb-mr2-dev
* commit '25f6f4f5d082828fe0eb4f24be2bfaa15b71242e':
  Update Canvas.getClipBounds to not account for AA clips.
2013-05-17 14:14:32 -07:00
Romain Guy
25f6f4f5d0 am 3c1ad55f: Merge "Update Canvas.getClipBounds to not account for AA clips." into jb-mr2-dev
* commit '3c1ad55fcfa54c2c30073d07917da699d156dc58':
  Update Canvas.getClipBounds to not account for AA clips.
2013-05-17 14:12:43 -07:00
Derek Sollenberger
00a33a8ce8 Update Canvas.getClipBounds to not account for AA clips.
This preserves the existing behavior at the SDK level while skia
investigates a more comprehensive solution.

bug: 8986473
Change-Id: Ief82dcfd47f1ba08d28d43402b3c28694f94f2e4
2013-05-16 09:31:27 -04:00
Brian Carlstrom
6155251c7b am bf7afa23: am 94f55b30: Merge "Tracking libnativehelper dependencies"
* commit 'bf7afa239e9541b3cac5a3c510bfb9b25b4a1348':
  Tracking libnativehelper dependencies
2013-05-10 22:49:00 -07:00
Brian Carlstrom
bf7afa239e am 94f55b30: Merge "Tracking libnativehelper dependencies"
* commit '94f55b30e3e04dbea63836197e76c7464d8d6d37':
  Tracking libnativehelper dependencies
2013-05-10 22:47:57 -07:00
Brian Carlstrom
fde1f91d9b Tracking libnativehelper dependencies
Change-Id: I05ec62c43fbe5f8ba23256abac7271ca0b1a7242
2013-05-10 21:16:12 -07:00
Dianne Hackborn
b14e42f121 Merge "Cleanup some of the thread merging." 2013-05-09 22:30:30 +00:00
Derek Sollenberger
0c8c0add4e am c195ef73: am bee78812: Merge "Fix bug where we incorrectly clipped the bounds to the device size." into jb-mr2-dev
* commit 'c195ef73445c3ba605355798b9f1f9a78bc52f11':
  Fix bug where we incorrectly clipped the bounds to the device size.
2013-05-09 14:19:45 -07:00
Raph Levien
8987f06f9c resolved conflicts for merge of 7e433f10 to master
Change-Id: Ifa3a144c791c0143c62f4aa23a5db57a93c32a17
2013-05-09 14:08:14 -07:00
Derek Sollenberger
bee78812d0 Merge "Fix bug where we incorrectly clipped the bounds to the device size." into jb-mr2-dev 2013-05-09 18:23:57 +00:00
Raph Levien
dde8e539c3 Merge "Fix bug 8717690 Full-width Latin Letters Garbled on Tumblr App" into jb-mr2-dev 2013-05-09 18:04:39 +00:00
Derek Sollenberger
708144e828 Fix bug where we incorrectly clipped the bounds to the device size.
This CL also updates the documenation to make it clear that the API
returns in local space, not clipped to the size of the bitmap/device.

bug: 8747526
Change-Id: I389844672ce955341863f9940c3b401ab00dc1dc
2013-05-09 14:00:29 -04:00
Mathias Agopian
1f5762e646 libutils clean-up
Change-Id: I11ee943da23a66828455a9770fc3c5ceb4bbcaa9
2013-05-07 17:09:46 -07:00
Dianne Hackborn
efa92b2182 Cleanup some of the thread merging.
Adds an optimization for checking whether a looper is stuck,
with a new Looper method to see if its thread is currently
idle.  This will allow us to put a large number of loopers
in the monitor efficiently, since we generally won't have to
do a context switch on each of them (since most looper threads
spend most of their time idle waiting for work).

Also change things so the system process's main thread
is actually running on the main thread.  Because Jeff
asked for this, and who am I to argue? :)

Change-Id: I12999e6f9c4b056c22dd652cb78c2453c391061f
2013-05-07 15:33:26 -07:00
Jesse Hall
ce3fe5fd8a am 4d32a367: am 2787ba25: Merge "Register EGLExt JNI methods" into jb-mr2-dev
* commit '4d32a36759b619abdda9c895054f513aef3a3f03':
  Register EGLExt JNI methods
2013-05-07 10:18:38 -07:00
Jesse Hall
9ee0999bcb resolved conflicts for merge of 78df7b5e to master
Change-Id: I27076f5e6f747a006dcac7cd334cacf56dd57bd5
2013-05-06 16:04:53 -07:00
Raph Levien
dd0a91294b Fix bug 8717690 Full-width Latin Letters Garbled on Tumblr App
For fullwidth latin (or, more generally, a font considered as a complex
script, but not supported by the font specified), and for a font other
than a system default font, we were getting a mismatch in baseGlyphCount
between the shaping and painting fonts.

This patch preserves the original typeface in this case. In that sense,
it is a slightly more general fix for bug 8127795.

Change-Id: Ibdbfdb34eb7dc39cc8f0784a67c93c9af4ce6ab2
2013-05-06 15:00:41 -07:00
Jesse Hall
237c2b871f Register EGLExt JNI methods
Bug: 8678160
Change-Id: I8ecd2e6da2aee250b3433be18fff6af927b02994
2013-05-06 11:36:59 -07:00
Dave Burke
236cc476e6 Temporarily revert field name change (DO NOT MERGE)
VisualOn is using hidden fields, causing HBO and Xfinity to crash.
Bug: 8549617
Bug: 8331866

Change-Id: I35a9fe66dea8d56f4fcff9b492679226a17f4acc
2013-05-06 00:21:30 -07:00
Jesse Hall
02b7128f87 Merge "Add android.opengl.EGLExt class for EGL extensions" into jb-mr2-dev 2013-05-04 17:50:48 +00:00
Romain Guy
8add80211e Merge "Add an on-screen overdraw counter" 2013-05-04 00:27:28 +00:00
Romain Guy
78dd96d5af Add an on-screen overdraw counter
The counter can be enabled by setting the system property called
debug.hwui.overdraw to the string "count". If the string is set
to "show", overdraw will be highlighted on screen instead of
printing out a simple counter.

Change-Id: I9a9c970d54bffab43138bbb7682f6c04bc2c40bd
2013-05-03 17:08:20 -07:00
Jeff Brown
b468877f7f am f87d4ea7: am 17cf4e4d: Merge "Really make Surface thread-safe." into jb-mr2-dev
* commit 'f87d4ea77a6950c3d6d381347f2346c12bee25f4':
  Really make Surface thread-safe.
2013-05-03 11:24:20 -07:00
Jeff Brown
17cf4e4d4a Merge "Really make Surface thread-safe." into jb-mr2-dev 2013-05-03 02:11:03 +00:00
Mathias Agopian
b7446f9ddb Merge "simplify Surface{View} dirty rect handling" 2013-05-02 23:26:26 +00:00
Romain Guy
3b748a44c6 Pack preloaded framework assets in a texture atlas
When the Android runtime starts, the system preloads a series of assets
in the Zygote process. These assets are shared across all processes.
Unfortunately, each one of these assets is later uploaded in its own
OpenGL texture, once per process. This wastes memory and generates
unnecessary OpenGL state changes.

This CL introduces an asset server that provides an atlas to all processes.

Note: bitmaps used by skia shaders are *not* sampled from the atlas.
It's an uncommon use case and would require extra texture transforms
in the GL shaders.

WHAT IS THE ASSETS ATLAS

The "assets atlas" is a single, shareable graphic buffer that contains
all the system's preloaded bitmap drawables (this includes 9-patches.)
The atlas is made of two distinct objects: the graphic buffer that
contains the actual pixels and the map which indicates where each
preloaded bitmap can be found in the atlas (essentially a pair of
x and y coordinates.)

HOW IS THE ASSETS ATLAS GENERATED

Because we need to support a wide variety of devices and because it
is easy to change the list of preloaded drawables, the atlas is
generated at runtime, during the startup phase of the system process.

There are several steps that lead to the atlas generation:

1. If the device is booting for the first time, or if the device was
updated, we need to find the best atlas configuration. To do so,
the atlas service tries a number of width, height and algorithm
variations that allows us to pack as many assets as possible while
using as little memory as possible. Once a best configuration is found,
it gets written to disk in /data/system/framework_atlas

2. Given a best configuration (algorithm variant, dimensions and
number of bitmaps that can be packed in the atlas), the atlas service
packs all the preloaded bitmaps into a single graphic buffer object.

3. The packing is done using Skia in a temporary native bitmap. The
Skia bitmap is then copied into the graphic buffer using OpenGL ES
to benefit from texture swizzling.

HOW PROCESSES USE THE ATLAS

Whenever a process' hardware renderer initializes its EGL context,
it queries the atlas service for the graphic buffer and the map.

It is important to remember that both the context and the map will
be valid for the lifetime of the hardware renderer (if the system
process goes down, all apps get killed as well.)

Every time the hardware renderer needs to render a bitmap, it first
checks whether the bitmap can be found in the assets atlas. When
the bitmap is part of the atlas, texture coordinates are remapped
appropriately before rendering.

Change-Id: I8eaecf53e7f6a33d90da3d0047c5ceec89ea3af0
2013-05-02 13:32:09 -07:00
Jeff Brown
fc0ebd7d37 Really make Surface thread-safe.
There were many places where the native object was being
accessed improperly.  Also some places where CloseGuard might
not be acquired or released correctly or where the generation
count might not be updated.

Fixed them all.

That said, Surface isn't intended to be used concurrently
so please don't do it.  This is only intended to make
hard to find crashes less likely.

Bug: 8328715
Change-Id: I981ef33425823e0fd7ad6b64443f2ec9b0c8335e
2013-05-01 15:28:01 -07:00
Jesse Hall
0c79d808cb Add android.opengl.EGLExt class for EGL extensions
Add the ES-relevant constants from the EGL_KHR_create_context
extension. These allow apps to check which EGLConfigs (if any) support
ES3 contexts. Otherwise, the app has to create a context with an
EGLConfig and then check whether it is an ES2 or ES3 context.

Also move eglSetPresentationTimeANDROID from EGL14 to EGLExt, since it's an
extension function. It's new in API 18.

Bug: 8678160
Change-Id: I3cba6e59ebb0a3a4c4012aa54a36b940c288bcec
2013-05-01 13:46:58 -07:00
Jesse Hall
fcafc3259e am 0b30ad53: am 09f3cc2b: Merge "Fix GLES30 JNI registration" into jb-mr2-dev
* commit '0b30ad53423a9bfab53b1632a33159be3d82e3df':
  Fix GLES30 JNI registration
2013-04-30 19:38:14 -07:00
Romain Guy
4225d79656 Merge "Handle Surface::lock errors in TextureView Bug #8689535" 2013-04-30 18:58:17 +00:00
Romain Guy
53bacf5a91 Handle Surface::lock errors in TextureView
Bug #8689535

Change-Id: I6d16e13903a58e93940160e7656147656ab79982
2013-04-30 11:30:10 -07:00
Jesse Hall
d877efe3b1 Fix GLES30 JNI registration
Bug: 8657863
Change-Id: I498f32480863b0716b2a8dfce467143087573cce
2013-04-29 16:02:16 -07:00