2520 Commits

Author SHA1 Message Date
Jesse Hall
9ee0999bcb resolved conflicts for merge of 78df7b5e to master
Change-Id: I27076f5e6f747a006dcac7cd334cacf56dd57bd5
2013-05-06 16:04:53 -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
Andy McFadden
c305745f19 Merge "Regenerate GL stubs" 2013-04-29 18:22:37 +00:00
Jeff Sharkey
2b4d22cda3 Disable various sampling event logs.
They're unused at the moment.

Change-Id: Ib629b405e7b6666d38fcd0ebaa16490bfb0e95f0
2013-04-26 10:52:00 -07:00
Matthew Xie
6a78365072 am 7a21c4cd: am 7f3c5d16: Merge "Added flush() for bluetooth output stream" into jb-mr2-dev
* commit '7a21c4cdb172f6353cd4166e80910893dc981196':
  Added flush() for bluetooth output stream
2013-04-25 21:26:56 -07:00
Andy McFadden
cee5198e71 Regenerate GL stubs
The primary motivation was to pick up changes to getarray(), but it
appears a few other tweaks were made since the last time the code
was generated.

Bug 8713753

Change-Id: I4fa2276bc28afaf0e1450e63498a8690028808ee
2013-04-25 16:08:31 -07:00
zzy
71bfafc84a Added flush() for bluetooth output stream
Bug 8498784

Zebra QL420 Plus Bluetooth printer fails on Android 4.2.2
2013-04-24 00:24:34 -07:00
Raph Levien
41f7f9c5bc am fdd40823: am 22a3344c: Merge "Fix for bug 8695466 GPOS combining mark positioning broken before space" into jb-mr2-dev
* commit 'fdd408233db5bd70cb43ddf2a49a85bd748da5b9':
  Fix for bug 8695466 GPOS combining mark positioning broken before space
2013-04-23 15:02:04 -07:00
Raph Levien
22a3344cda Merge "Fix for bug 8695466 GPOS combining mark positioning broken before space" into jb-mr2-dev 2013-04-23 21:19:20 +00:00
Raph Levien
9d47db23ff Fix for bug 8695466 GPOS combining mark positioning broken before space
This patch makes segmentation into script runs behave the same in RTL
as in LTR modes - so that inherited script characters are always
associated with the preceding run. Otherwise, for a sequence such as
u+0631 u+064d u+0020, it would get split after the first character,
which would lose the ability to correctly position the u+064d mark.

Change-Id: I3c12ba1b77d18334f55e707f518be1046e6b339b
2013-04-23 12:51:27 -07:00
Michael Wright
058feb4e1d am 58500051: am 5fe6e4c4: Merge "Rewrite input handling for native applications" into jb-mr2-dev
* commit '585000515faacc02736f920425ae6c323223ee58':
  Rewrite input handling for native applications
2013-04-23 11:16:08 -07:00
Michael Wright
5fe6e4c4c9 Merge "Rewrite input handling for native applications" into jb-mr2-dev 2013-04-23 00:04:44 +00:00
Michael Wright
a44dd26a75 Rewrite input handling for native applications
Bug: 8473020
Change-Id: Ic4353d8924ab877bec21aff8c2dba9fe725bf906
2013-04-22 17:01:51 -07:00
Chet Haase
684634144b am 371d4ccc: am 339ac854: Merge "Fix quickReject logic to account for setClipChildren() setting" into jb-mr2-dev
* commit '371d4cccde56ec4d26e51f8e82ef68f196169a3d':
  Fix quickReject logic to account for setClipChildren() setting
2013-04-20 21:37:23 -07:00
Chet Haase
dd671599be Fix quickReject logic to account for setClipChildren() setting
The rendering code optimizes by rejecting drawing operations that
lie outside of the bounds of their views. This works in most
situations, but breaks down when containers have called
setClipChildren(false), because we reject drawing that is outside
of that container, but which should be drawn anyway.

Fix is to pass in the value of that flag to the DisplayList drawing
routines which take that flag into account when deciding whether
to quickReject any particular operation.

Issue #8659277 animation clipping

Change-Id: Ief568e4db01b533a97b3c5ea5ad777c03c0eea71
2013-04-19 15:36:37 -07:00
Mathias Agopian
667809ef5d simplify Surface{View} dirty rect handling
Change-Id: Ia4595fc1a8a62ca3f3db0f1e47e7e877d73fbfa0
2013-04-18 17:10:00 -07:00
Eino-Ville Talvala
2661bbd219 Merge "Camera: Add hidden camera preview to renderscript allocation API" 2013-04-18 22:44:47 +00:00
Eino-Ville Talvala
7005b67c12 Camera: Add hidden camera preview to renderscript allocation API
- Camera.createPreviewAllocation() creates YUV allocations for use as
  a preview buffer destination.

- Camera.setPreviewCallbackAllocation() sets such an allocation as the
  target for preview data from camera.

Bug: 8563840
Change-Id: Ie42033976fed825d396550bbc033d434c8206b6b
2013-04-17 18:35:26 -07:00
Victoria Lease
af1653a851 resolved conflicts for merge of 6c18e2c8 to master
Change-Id: Idb4679247b201a1f453c63fee5b45b12b03a67a1
2013-04-17 10:33:23 -07:00
Victoria Lease
25df1a82a8 Merge "use appropriate fallback chain for style" into jb-mr2-dev 2013-04-17 16:23:38 +00:00
Jamie Gennis
a720a87fde am a0b28ca7: am 95a869f9: Merge "Disable tracing from Zygote" into jb-mr2-dev
* commit 'a0b28ca74806dcf46300d82ebb689b002bd36955':
  Disable tracing from Zygote
2013-04-16 17:01:12 -07:00
Jamie Gennis
6ad0452e63 Disable tracing from Zygote
This change disables all atrace tracing in Zygote immediately after it is
initialized.  This is necessary because Zygote has no way to receive
notifications that the enabled trace tags have been changed.  Tracing is
re-enabled when other processes fork from Zygote.

Change-Id: If2983858fb0c4890ba9ab041849b1c4d98f66c13
2013-04-16 22:15:21 +00:00
Jesse Hall
8065804653 am f454b52e: am 811d3734: Merge "Add android.opengl.GLES30, hidden for now" into jb-mr2-dev
* commit 'f454b52ee7d7bdd2fe207860921ca58eeed19017':
  Add android.opengl.GLES30, hidden for now
2013-04-16 14:38:59 -07:00
Jesse Hall
811d373444 Merge "Add android.opengl.GLES30, hidden for now" into jb-mr2-dev 2013-04-16 21:32:36 +00:00
Victoria Lease
cc0f9d8469 use appropriate fallback chain for style
TextLayoutShaper was defaulting to the Regular-style fallback chain
for all unknown scripts. This became problematic in that the
codepoint->glyphID enumeration stage of shaping was always using the
Regular-style fallback chain for unknown scripts, and there's no
guarantee that glyph indices are compatible between fallback chains.

Defaulting to a style-appropriate fallback chain addresses this
issue, and probably unreported but related issues, as well.

Bug: 8189208
Change-Id: I6ecf531c74d71a8e4a5359d23439ccc950b0cf80
2013-04-16 09:51:45 -07:00
Jesse Hall
d830e74ff4 Add android.opengl.GLES30, hidden for now
Bug: 8566953
Change-Id: Ia5a01d5e857b4fce12a451e2dcab0359758ad648
2013-04-15 17:37:33 -07:00
Dianne Hackborn
11dc37686f am 18e99d1d: am 15fed390: Merge "Add new resources trace, also trace apk dex loading." into jb-mr2-dev
* commit '18e99d1d5f7bb2e35fb9f5c3edbb4265d66e3d93':
  Add new resources trace, also trace apk dex loading.
2013-04-12 17:06:37 -07:00
Dianne Hackborn
15fed390c4 Merge "Add new resources trace, also trace apk dex loading." into jb-mr2-dev 2013-04-12 23:58:50 +00:00
Dianne Hackborn
f7be4800df Add new resources trace, also trace apk dex loading.
Change-Id: Ia48566efb21ee018659bd976ddb3a0f4997b9a3a
2013-04-12 14:53:10 -07:00
Romain Guy
190a0f24db am a378bab7: am 50b68bf8: Merge "Add async events tracing to android.os.Trace" into jb-mr2-dev
* commit 'a378bab7a7ea4f748c72b0d14acbdf9359dbebfb':
  Add async events tracing to android.os.Trace
2013-04-12 14:04:07 -07:00
Romain Guy
50b68bf836 Merge "Add async events tracing to android.os.Trace" into jb-mr2-dev 2013-04-12 20:58:00 +00:00
Jaikumar Ganesh
339d051957 am 380043de: am 9a8df4dc: Add new sensor types.
* commit '380043deb0607262505baa2d3c8a46a8277697e5':
  Add new sensor types.
2013-04-11 10:56:11 -07:00
Jaikumar Ganesh
9a8df4dcf9 Add new sensor types.
1. Add uncalibrated gyros and magnetic field sensor.
2. Change max number of events from 3 to 16.
3. Add new APIs for trigger sensors.

Change-Id: Ifac5c0024c8e5f88b721e5cd97ff26afaaa36717
2013-04-11 10:25:35 -07:00
Romain Guy
9425f923fa Add async events tracing to android.os.Trace
Change-Id: I106a50732a88c03a00602c328f8b46626bf66e08
2013-04-10 16:35:48 -07:00
Derek Sollenberger
7a5583fe36 am 8225c5b3: am c37b63d6: Merge "Ensure that a canvas is always backed by some form of SkDevice." into jb-mr2-dev
* commit '8225c5b3d925324dac7703fba0fd5a0f126afed6':
  Ensure that a canvas is always backed by some form of SkDevice.
2013-04-10 05:18:41 -07:00
Derek Sollenberger
c37b63d6e7 Merge "Ensure that a canvas is always backed by some form of SkDevice." into jb-mr2-dev 2013-04-10 12:11:14 +00:00
Ying Wang
28af35e8cd resolved conflicts for merge of a976bddd to master
Change-Id: I64e1cbfb0eee891ce4d1eee40eefdcedcc501f7f
2013-04-09 23:21:42 -07:00
Ying Wang
d8b26d6c42 Merge "Add liblog" into jb-mr2-dev 2013-04-10 05:16:14 +00:00