5026 Commits

Author SHA1 Message Date
Tim Murray
d8c8aaa82e Handle updates to C++ API.
Change-Id: I8ab17cbae3a9a4cc3c3202b8277d49f27bdf1fec
2013-08-19 12:07:52 -07:00
Romain Guy
46bfc48110 Fix hardware layers lifecycle
Bug #10075732

Hardware layers could survive across EGL terminate events.

Change-Id: Ie8565d55cb29fe6625fa1584d695edfecd37ab5e
2013-08-16 18:38:29 -07:00
Romain Guy
b0a41ed3dc Prevent ANR in apps using drawPath()
Bug #10347089

If an app clears its path cache before stopping background tasks, it could
get into an infinite loop in PathCache::trim().

Change-Id: Ieb865b762e7b00aebaba0c023769c2db286a94f5
2013-08-16 14:44:38 -07:00
Romain Guy
b746371de7 Clear FBO cache on full memory flush
Change-Id: I44e06d5d15cd899a0522c62d7c0d042170665abb
2013-08-16 13:55:29 -07:00
Victoria Lease
723b2feb92 fix kBW_Format glyphs
Oops! kBW_Format was omitted from a couple of switch statements,
resulting in glyphs in that format being invisible.

Bug: 10206452
Change-Id: Ib2aa52250aeeecc0de1b1b78e3d0f568f368c73e
2013-08-12 15:12:49 -07:00
Romain Guy
9b5a1a28c3 Take shadow bounds into account for quick rejects
Bug #8634346

Change-Id: I995c5205c2959d8e4da638ae47fedcda92eb1b36
2013-08-09 14:06:29 -07:00
Romain Guy
003123004f Remove an unnecessary allocation
Also remove dead code from OpenGLRenderer.cpp

Change-Id: I7eb54ca19e77ee3c32f1fe9513a031e6b2e115cf
(cherry picked from commit 5c7d5ab878b26f855175a3305a14ac12fcacf25e)
2013-08-09 03:52:29 +00:00
Romain Guy
7f6d6b0370 Split assets atlas batches
Bug #10185769

The assets atlas contains assets that need to be blended and assets
that do not need to be blended. With a single merge id, currently
set to be the pointer to the atlas itself, draw ops merging could
generate batches of commands containing both opaque and translucent
assets. The blend state was chosen from only one of the assets in
the batch, leading either to inefficiencies (blending large opaque
assets) or incorrect behaviors (not blending translucent assets.)

This change introduces two new merge ids in the atlas: an opaque
key and a blend key. These keys are simple booleans set to false
and true respectively (the values do not matter really.) Their
memory addresses are used as the merge ids when createing draw ops
batches, allowing all opaque ops to be batched together and all
translucent ops to be batched together.

Change-Id: I114dba0533c44987e53864b471ccb28c811f2025
2013-08-06 18:35:01 -07:00
Elliott Hughes
83ad4e393a Remove an unused C zip API.
Change-Id: I10ae849bdedf3e3bb97547c4f9e5a20742e9d6b1
2013-08-05 14:12:50 -07:00
Tim Murray
250b1cfc83 Handle updates to RS C++ API.
Change-Id: I73127fc7369643b94d4a49f31a516b50c74b54ac
2013-08-02 15:31:29 -07:00
Chris Craik
b213cec0ce Merge "Fix quickReject's handling of AA ramp geometry" 2013-08-02 20:34:38 +00:00
Chris Craik
5e49b307eb Fix quickReject's handling of AA ramp geometry
By having quickReject round out the window-space geometry bounds, we
prevent the AA perimeter (which falls outside the local bounds passed
in) from drawing outside the clip.

Change-Id: I8ee36be9039a9c47906815ee2f0dbaa5eb910b82
2013-08-02 11:29:22 -07:00
Romain Guy
b7b93e0089 Fix region clipping bugs
See external bug #58344

Change-Id: Iecd6c41fc8076cd76add2335d3442a6dd8878f12
2013-08-01 15:35:24 -07:00
Victoria Lease
f296e317fb Merge "Support RGBA fonts and bitmap fonts (and RGBA bitmap fonts)" 2013-08-01 14:40:54 +00:00
Dianne Hackborn
d45c68dd24 Resource memory optimization.
Don't ever need the cached UTF-16 string conversions on the
device.  Don't need to create those strings, and don't need
to create the lookup array for them at all.  This requires
fixing all of the remaining places in the platform where we
interacted with the resources with the blind assumption that
the strings are UTF-16.

Change-Id: Ia0e5a150499837471e494e85b23b05fa06e0cf1d
2013-07-31 15:57:49 -07:00
Victoria Lease
1e546815bb Support RGBA fonts and bitmap fonts (and RGBA bitmap fonts)
Quite a few things going on in this commit:

- Enable bitmap strikes by default in Paint objects.

The SkPaint parameter that enables bitmap strikes was not previously
included in DEFAULT_PAINT_FLAGS. This effectively disabled bitmap
fonts. Oops! It's for the best, though, as additional work was needed
in Skia to make bitmap fonts work anyway.

- Complain if TEXTURE_BORDER_SIZE is not 1.

Our glyph cache code does not currently handle any value other than 1
here, including zero. I've added a little C preprocessor check to
prevent future engineers (including especially future-me) from
thinking that they can change this value without updating the related
code.

- Add GL_RGBA support to hwui's FontRenderer and friends

This also happened to involve some refactoring for convenience and
cleanliness.

Bug: 9577689
Change-Id: I0abd1e5a0d6623106247fb6421787e2c2f2ea19c
2013-07-31 15:50:47 -07:00
Romain Guy
fb6c743c6e Merge "Fix 9patches' limitation of 32 empty quads" 2013-07-24 18:54:11 +00:00
Romain Guy
6cad75744e Fix 9patches' limitation of 32 empty quads
The 9patch format allows to define more empty quads than this, remove
the use of a single int to index empty quads and replace it with a
lookup in the 9patch resource data structure.

Change-Id: I148ee5d9e0c96822b534a344e15c9d88078db7c2
2013-07-24 11:49:33 -07:00
Colin Cross
0d6e7315eb add static dependency on liblog
Change-Id: I8056aa744b37ef0c31229329a0de79c58c5955ea
2013-07-23 18:04:24 -07:00
Chris Craik
98427708a8 Merge "Ensure glActiveTexture is cleaned up correctly on functor resume" 2013-07-22 23:31:20 +00:00
Chris Craik
9ab2d18475 Ensure glActiveTexture is cleaned up correctly on functor resume
Change-Id: I103d7d63b17289d599c2c08dcc442cfba9b8e51d
2013-07-22 16:21:55 -07:00
Romain Guy
448455fe78 Use global indices array to draw layers
An array of indices local to a layer would only be necessary if
we changed the way we resolve T-junctions. Since we only ever
draw quads, let's just use the indices we use everywhere else.

This change also uses the global indices array to render list
of colored rectangles to save on the number of vertices generated
CPU-side.

Change-Id: Ia6d1970b0e9247805af5a114ca2a84b5d0b7c282
2013-07-22 14:37:21 -07:00
Chris Craik
b3d8388822 Merge "Support stencil-based clipping for functors" 2013-07-16 22:43:02 +00:00
Romain Guy
4e7b772b73 Fix crashes in setMatrix() and concat()
setMatrix() was crashing in native code, only with hw acceleration on.
concat() would throw a NullPointerException. It now ignores null matrices.

Change-Id: Iebd8b410a957d2ba501570c6fbb3f680ff4a1a23
2013-07-16 14:52:55 -07:00
Chris Craik
ecca6da4ea Support stencil-based clipping for functors
bug:9070351
Change-Id: I1c54e1bea1b84b1619cce27b14f189b42cab7062
2013-07-16 13:27:18 -07:00
Chris Craik
0c20c3898a Use global references for Bitmap AndroidPixelRefs
bug:9621717

Because we're no longer holding onto Bitmaps Java side during
DisplayList lifetime, use global refs to keep the backing byte arrays
around.

Adds back bitmap buffer passing + native ref management removed by
3b748a44c6bd2ea05fe16839caf73dbe50bd7ae9

Adds back globalRef-ing removed by
f890fab5a6715548e520a6f010a3bfe7607ce56e

Change-Id: Ia59ba42f05bea6165aec2b800619221a8083d580
2013-07-08 11:08:02 -07:00
Jeff Brown
9d3b1a424c Move input library code to frameworks/native.
No longer compile libandroidfw as a static library on the device
since it already exists as a shared library.  Keeping the static
library would force us to provide a static library version of
libinput for the device as well which doesn't make sense.

Change-Id: I3517881b87b47dcc209d80dbd0ac6b5cf29a766f
2013-07-01 20:11:42 -07:00
Romain Guy
c36fe2fc53 am 55e789db: am ed96349a: am 3d1b158e: Merge "Fix out of range glCopyTexImage2D Bug #9425270" into jb-mr2-dev
* commit '55e789dbc782be0dcaf1d4bae5f32e9e2f674152':
  Fix out of range glCopyTexImage2D Bug #9425270
2013-06-28 11:15:02 -07:00
Romain Guy
b254c242d9 Fix out of range glCopyTexImage2D
Bug #9425270

A better solution would be to use glCopyTexImage2D whenever possible but
this change would be a little more dangerous.

Change-Id: Ib1aaceda39d838716285ef97f356721416822dbb
2013-06-27 17:15:24 -07:00
Romain Guy
55b6f95ee4 Track the atlas' generation ID
Bug #9589379

If the atlas is terminated/reinitialized and a view does not invalidate
in between it might end up using a stale AssetAtlas::Entry. This change
is similar to how 9patch meshes are cached in DrawPatchOp: we simply
track the generation ID of the cache to make sure we always use the
latest data.

Change-Id: Ib5abb3769d2ce0eabe9adc04e320ca27c422019e
2013-06-27 15:40:46 -07:00
Romain Guy
e3b0a0117a Refcount 9-patches and properly handle GC events
This change adds refcounting of Res_png_9patch instances, the native
data structure used to represent 9-patches. The Dalvik NinePatch class
now holds a native pointer instead of a Dalvik byte[]. This pointer
is used whenever we need to draw the 9-patch (software or hardware.)

Since we are now tracking garbage collection of NinePatch objects
libhwui's PatchCache must keep a list of free blocks in the VBO
used to store the meshes.

This change also removes unnecessary instances tracking from
GLES20DisplayList. Bitmaps and 9-patches are refcounted at the
native level and do not need to be tracked by the Dalvik layer.

Change-Id: Ib8682d573a538aaf1945f8ec5a9bd5da5d16f74b
2013-06-26 17:15:08 -07:00
Romain Guy
f296dca95f (Small) 9patch drawing improvements
Save a bit of memory in meshs generated from native code
Avoid an extra if/else when drawing with hardware accelration on

Change-Id: I31a4550bde4d2c27961710ebcc92b66cd71153cc
2013-06-24 16:45:41 -07:00
Chris Craik
4f20f8ae50 Merge "Initialize MergingDrawBatch clip with viewport bounds" 2013-06-21 20:51:54 +00:00
Chris Craik
0e87f00f8c Initialize MergingDrawBatch clip with viewport bounds
This allows merged, clipped operations to behave correctly within a
savelayer, even if the base viewport has a large offset.

Additionally, disregard opaqueness when within a
complexclip/savelayer, as the coverage can't be trusted.

Change-Id: Ic908b82a4bb410bc7fac1b4295f4874ed166efc5
2013-06-21 13:16:31 -07:00
Romain Guy
64d592129e Merge "Refcount the paint used by Canvas.drawPatch()" 2013-06-21 18:37:56 +00:00
Romain Guy
16ea8d373b Refcount the paint used by Canvas.drawPatch()
Prevents crashes :)

Change-Id: I62103ce97490613142321f080b82c2edaed67a95
2013-06-21 11:35:52 -07:00
Romain Guy
2c290392c9 Merge "Batch 9-patches in a single mesh whenever possible" 2013-06-21 17:42:23 +00:00
Chris Craik
ede7eb7749 Merge "Make op outputting const, for more general logging" 2013-06-21 17:39:14 +00:00
Romain Guy
03c00b5a13 Batch 9-patches in a single mesh whenever possible
This change also fixes the way batched bitmaps were handled
inside a layer. The layer is now correctly dirtied to minimize
the amount of pixels to blend.

Fix alpha, mode and opaque computations for DrawPatchOp.

Change-Id: I1b6cd581c0f0db66c1002bb4fb1a9811e55bfa78
2013-06-21 10:13:58 -07:00
Romain Guy
d485ef27c7 Merge "An identity matrix should be considered a pure translate matrix" 2013-06-21 01:31:55 +00:00
Romain Guy
f6bed4f12a An identity matrix should be considered a pure translate matrix
Change-Id: I75e91797e8270f902f67bdd7bb526cccc23adc6b
2013-06-20 17:52:07 -07:00
Romain Guy
d4fed90d24 Merge "Add debugging logs for GPU pixel buffers" 2013-06-20 23:32:40 +00:00
Romain Guy
9e6f3ac109 Add debugging logs for GPU pixel buffers
Change-Id: I7edb04dd30ee6fd823099e72788169cc185e70f2
2013-06-20 16:31:35 -07:00
Jeff Brown
8e1af51787 Merge "input: Handle a few extra error conditions." 2013-06-20 00:46:24 +00:00
Chris Craik
c5493fb7fa Make op outputting const, for more general logging
Change-Id: Iaf78985ee5558e0b5d32d7bc1cd039eaffc820e5
2013-06-19 16:58:58 -07:00
Romain Guy
fb5a41a371 Merge "Fix regression: TextureView.setAlpha() was ignored" 2013-06-19 23:40:57 +00:00
Romain Guy
2458939b5f Fix regression: TextureView.setAlpha() was ignored
Change-Id: I9f43eec0fe23a65dcc1cf9cd0ac1f5e8907786a7
2013-06-19 12:17:01 -07:00
Romain Guy
cadc5bf411 Merge "Share Caches' index buffer with FontRenderer" 2013-06-19 19:16:21 +00:00
Jeff Brown
0618148f90 input: Handle a few extra error conditions.
It turns out that SOCK_SEQPACKET sockets may sometimes return
ECONNREFUSED or ECONNRESET errors when the peer dies instead of
the usual EPIPE.

Bug: 9479906
Change-Id: Ia7e572b08bf63e43ba5aeda58281508beb5f8c73
2013-06-18 16:10:49 -07:00
Romain Guy
31e08e953f Share Caches' index buffer with FontRenderer
This reduces state changes when we draw 9patches and text together,
which happens *a lot*. Also disable the NV profiling extension by
default since it doesn't play nice with display lists deferrals.
To enable it set debug.hwui.nv_profiling to true.

Change-Id: I518b44b7d294e5def10c78911ceb9f01ae401609
2013-06-18 15:53:53 -07:00