5907 Commits

Author SHA1 Message Date
John Reck
b9a4d15d09 Merge "Force-flush state sync on texid change" into lmp-mr1-dev 2014-12-11 22:44:19 +00:00
Chris Craik
63c7b24645 Merge "Correct layer size formatting in trace" into lmp-mr1-dev 2014-12-11 22:43:18 +00:00
Chris Craik
c2379070a4 Correct layer size formatting in trace
bug:18722704
Change-Id: Icef9aaa62633b2d86ad250f43d4c8fa5cc0b6842
2014-12-11 14:29:51 -08:00
John Reck
9a7fe1a034 Force-flush state sync on texid change
Bug: 18718646

Caused because the Texture object thought the GLES texture
was in a different state than it was as it persists across
EGL/GL contexts. Fix this by force-flushing the default
values when the texid has changed.

Change-Id: I264bac9a2beb08df8e2ba8a85ad15f0dd1fce22a
2014-12-11 14:27:39 -08:00
John Reck
eb2dcc791e Merge "Don't preload textures for AssetAtlas" into lmp-mr1-dev 2014-12-11 01:12:31 +00:00
John Reck
ebd52610cf Don't preload textures for AssetAtlas
Bug: 18317479

RenderNode::prepareSubTree calls prefetchAndMarkInUse
on every bitmapResoruce in the DisplayList. However,
this resulted in textures being uploaded for bitmaps
that would be drawn from the AssetAtlas instead.

To fix this we teach TextureCache about the AssetAtlas
so that calls to TextureCache return the Texture from
AssetAtlas if it exists. Thus usage of AssetAtlas
is now purely to allow for further optimizations via
draw merging instead of a requirement to get
any benefit at all.

Change-Id: I65282fa05bac46f4e93822b3467ffa0261ccf200
2014-12-10 17:07:41 -08:00
Adam Lesinski
c780187745 Merge "Fix issue where non-resource attributes would cause obtainStyleAttributes to fail" into lmp-mr1-dev 2014-12-10 21:12:04 +00:00
Chris Craik
4ac36f80be Fix frame-allocated path lifecycles
bug:18667472

Previously, we were allocating per-frame temporary paths within the
PlaybackStateStruct, but these are not safe as layers allocate these
transiently. Instead, move these to the OpenGLRenderer, which has
better define lifecycle.

Additionally, don't store SkPath objects directly in vector, since
they are then subject to relocation.

Change-Id: I8187ef542fcd5b030502bb75eb123ee26c0daa96
2014-12-10 12:27:08 -08:00
Adam Lesinski
5dce5e67db Fix issue where non-resource attributes would cause obtainStyleAttributes to fail
A sentinal value of 0x00000000 was used to mark the first time an AttributeFinder
was used. If the resource ID of an attribute was also 0x00000000 (which occurs with
non-resource attributes, like 'style'), then it would be mistaken as the sentinel
start value.

Bug:18421787
Change-Id: I4be353e0f8c940cb6f262d155129f048dcc444ae
2014-12-10 10:51:48 -08:00
John Reck
4f1942d999 Merge "Teach AssetAtlas about more drawables" into lmp-mr1-dev 2014-12-09 23:12:42 +00:00
John Reck
dad7d84c04 Teach AssetAtlas about more drawables
Bug: 18317479

Change-Id: I16868ee204d24af72af9a2efc987f7e9eb1d266b
2014-12-09 14:18:33 -08:00
Derek Sollenberger
ee648e517f Remove unnecessary/erroneous reference counting
The SkBitmap* used by HWUI holds a reference to the PixelRef (which
in turn holds the colorTable) so keeping an additional ref is not
only unnecessary, but also potentially problematic.

If a bitmap changes its pixelRef after it has been added to a displayList,
then we end up with unbalanced ref/unref calls that cause the newly added
PixelRef to be unref'd and prematurely deleted, while the original PixelRef
is leaked.

bug: 18659976
Change-Id: I34a06152e7bb2d733249a207dafd36b9b5dc0712
2014-12-09 18:36:42 +00:00
Adam Lesinski
720beef28d Merge "AAPT: Move private attrs to new type for framework" into lmp-mr1-dev 2014-12-04 18:24:41 +00:00
Adam Lesinski
9b624c186c AAPT: Move private attrs to new type for framework
Private attributes are typically placed after public
attributes in the resource table. Each time a new version
of the Android framework is released, new public attributes
take the place of the private attributes, and the private
attributes are shifted after the new public ones.

This means that any apps built against the newer SDK
may inadvertently be using private attributes on older
devices.

This change moves all private attributes to a completely
different type ID, so there will never be collisions across
versions.

These private attributes are automatically moved to a synthesized
type only for the system resources.

Bug:18263655

Change-Id: I7a850512953fadcc9f3524d509cea30249782db8
2014-12-03 15:59:20 -08:00
John Reck
01a5ea35fb Resume RT-animations after a pauseSurface
Bug: 18203577

The issue occurs as a result of performTraversals() both doing
a window relayout call *and* early-returning because it's not dirty.

To fix this pauseSurface() returns whether or not the RT-side is
"dirty" to force ViewRootImpl to do a draw even if mDirty is
otherwise empty.

Change-Id: I534f367e75d18d273ebf14df3927f5c464ef6bef
2014-12-03 13:03:59 -08:00
Chris Craik
ef124887c6 Merge "Clip outline to View clip bounds for shadow computation" into lmp-mr1-dev 2014-12-02 01:27:26 +00:00
Chris Craik
faa79ff9d9 Clip outline to View clip bounds for shadow computation
bug:18509823

This allows animations of View clipBounds (and other callers of
setClipBounds) to affect shadows, instead of leaving them floating.

Change-Id: I249fa4b371a170cb0c54001f5b0e0097e109b8b8
2014-12-01 15:47:10 -08:00
John Reck
76de89820c Merge "Prevent calling GL functions with an invalid surface" into lmp-mr1-dev 2014-12-01 22:39:31 +00:00
Sangkyu Lee
a12b2405df Prevent calling GL functions with an invalid surface
Bug: 18518580

When destroying CanvasContext, the surface can be invalid
state. So the surface should be updated to null prior to
destroying GL resources to ensure that GL functions
are not called with an invalid surface.
Some GL implementation makes an error if GL functions
are called with an invalid surface. (Adreno 3xx)

Cherry picked from AOSP: f76d36f96bf221672e98e440c9df7cbf0e02e84e

Change-Id: Ie6f6ea081ec931fc9df30b2c3ed066ec1ae9d294
2014-12-01 21:38:34 +00:00
Chris Craik
659de832b9 Merge "Enable stencil clipping within clearLayerRegions" into lmp-mr1-dev 2014-12-01 20:08:29 +00:00
Chris Craik
ca84c8b1b0 Merge "Revert "Force-use the pbuffer surface for destroy"" into lmp-mr1-dev 2014-11-26 20:50:10 +00:00
Chris Craik
9f81485a76 Revert "Force-use the pbuffer surface for destroy"
bug:18528859

This reverts commit b945f2313aee6e49a082ba5caaf95334d2570d52.

Change-Id: I6915624d356cb8570471eb3a5b8921f59b58db6d
2014-11-26 18:59:58 +00:00
Dohyun Lee
52b2cf9fdf Enable stencil clipping within clearLayerRegions
bug:18538502

Cherry-pick of adc0d9da8648abfea1035fb1108eceea9fd9b5b1 from AOSP

Previously stencil clipping within clearLayerRegions is disabled by commit
62d307c2402777d5e53b4590af5f32f8c55afd81. However, clearing whole layer
regions causes black-colored triangle regions when a TextView has
RotateAnimation because the draw within clearLayerRegions does not
affected by the current stencil clip.

Change-Id: Id32a0b16754b109905f833e063ebfa156bd953f2
Signed-off-by: Dohyun Lee <dohyun.lee@lge.com>
2014-11-26 10:51:32 -08:00
John Reck
dec3f138c2 Merge "Force-use the pbuffer surface for destroy" into lmp-mr1-dev 2014-11-25 19:52:53 +00:00
Chris Craik
ee6606519d Merge "Improve DisplayList state output" into lmp-mr1-dev 2014-11-25 18:45:11 +00:00
John Reck
b945f2313a Force-use the pbuffer surface for destroy
Bug: 18518580

If CanvasContext is being destroyed() the Surface
is probably no longer valid as well, so make sure to
makeCurrent() to the pbuffer surface so that the
subsequent GL operations are not using an invalid
EGLSurface

Change-Id: Ica5d6a065841772c47e00ad65aa7894c7e27e043
2014-11-25 09:54:13 -08:00
John Reck
71d08a0718 Switch TextureCache to SkPixelRef::fStableId
Bug: 18245805
Change-Id: I08e6792dbeed86b13e569c7f2137de0e50dc2763
2014-11-24 15:24:02 -08:00
Chris Craik
b5a5435a77 Improve DisplayList state output
bug:17991451

Log hardware layers and shadow casting

Change-Id: I2ae40f270d18f5b2a5af985513e0f5e8841216c2
2014-11-21 16:23:00 -08:00
Chris Craik
29dc496a42 Merge "Revert "Add a way to override Xfermode DO NOT MERGE"" into lmp-mr1-dev 2014-11-21 22:11:13 +00:00
Chris Craik
69e65019b0 Revert "Add a way to override Xfermode DO NOT MERGE"
Feature no longer needed.

bug:18448377

This reverts commit 4678dcc5524258908eadc5fe1e5e1874768967eb.

Change-Id: Ib0a19946e966a54857165555827b5fa7b34b6bea
2014-11-21 22:05:33 +00:00
Chris Craik
3b2ba44be3 Merge "Improve logging around performance critical events" into lmp-mr1-dev 2014-11-20 17:36:26 +00:00
Chris Craik
70850ea258 Improve logging around performance critical events
bug:17702227

Add details useful to developers (such as layer size/View name), and
switch away from logging implementation names/details, since they
are generally not relevant to developers.

Change-Id: Iee605d182f241450f7e75a6d0c283d51fa1312f5
2014-11-19 17:24:30 -08:00
John Reck
f0f68117c4 Merge "Trace some interesting events" into lmp-mr1-dev 2014-11-18 21:23:50 +00:00
Adam Lesinski
cd6f00c3a0 Merge "Implement back-tracking when searching for attributes in XML or resource bag" into lmp-mr1-dev 2014-11-17 19:39:17 +00:00
John Reck
fbc8df03e4 Trace some interesting events
Bug: 18337099
Change-Id: Ie2e60da2b9f06e0368061c944d8123ab6903355c
2014-11-17 10:18:31 -08:00
Rob Tsuk
41a8043b30 Merge "Add a way to override Xfermode DO NOT MERGE" into lmp-mr1-dev 2014-11-12 21:42:00 +00:00
ztenghui
4e50ee4f42 Merge "Shadow: Fix the crash in spot shadow" into lmp-mr1-dev 2014-11-12 21:16:31 +00:00
ztenghui
3932063bc7 Shadow: Fix the crash in spot shadow
Fix the crash from searching for closest umbra vertex by initialized the
starting index correctly.

Fix another potential crash related to ray intersection by introducing epsilon.

b/18315089

Change-Id: I9ac9a781a885701a8388714d44f79a1d905e5d33
2014-11-12 12:58:08 -08:00
Rob Tsuk
4678dcc552 Add a way to override Xfermode DO NOT MERGE
Add a non-public API to Canvas/GLES20Canvas to provide a way to draw
the touch ripple animation without using a save layer.

Change-Id: I6e2095adffe515194f669fb75bb67abf813bd518
2014-11-12 12:25:24 -08:00
John Reck
ca93f69c96 Merge "Have an actual fallback if the surface is lost" into lmp-mr1-dev 2014-11-07 22:41:03 +00:00
John Reck
aa95a88327 Have an actual fallback if the surface is lost
Bug: 17516789

This will force a relayout/reinitialize pass if the Surface
is lost mid-render instead of crashing on the next frame

Change-Id: If08bfa16f740728fa7c05904fa11e26f07b81e2e
2014-11-07 11:02:07 -08:00
John Reck
4b19b7aaff Merge "Fix wrong-thread issue" into lmp-mr1-dev 2014-11-07 18:34:55 +00:00
John Reck
12f5e34332 Fix wrong-thread issue
Bug: 18259560

Change-Id: Ic63a86efba9c86f21defac0695a73db8b09ae284
2014-11-07 10:31:53 -08:00
ztenghui
7ae6fc81ef Merge "A better looking and faster spot shadow." into lmp-mr1-dev 2014-11-06 23:59:17 +00:00
ztenghui
d2dcd6fded A better looking and faster spot shadow.
1. This improve the looking, the star shape (spike) on long action bar is gone.
Shadow is more smooth now.

2. The performance is better, too. For averaging around rect, round rect and
circle, the spot shadow itself is 3 times faster. On N7 v1, it could be less than
0.1 ms.

b/14976551
b/16712006

Change-Id: I61ed546ee56e7c8dbe504dfcaef12d084904b4b8
2014-11-06 15:09:46 -08:00
John Reck
a35778c799 Yank ResourceCache out of Caches
Bug: 17947547

Pull the ResourceCache (aka, ref-counting side channel) out of
Caches so that DisplayListRenderer doesn't use Caches, avoiding
the risk of instantiating Caches on the wrong thread or
without a GL context

Change-Id: I7d63b70b3b0a0163308c5dedd6ef255eadebe8fd
2014-11-06 09:45:10 -08:00
Rob Tsuk
6c96cbf581 Merge "Log shader source when it fails to compile" into lmp-mr1-dev 2014-11-05 22:22:52 +00:00
Rob Tsuk
fd15f47554 Log shader source when it fails to compile
So that there will be something to diagnose when such failures occur during
stability tests.

Bug: 18092655
Change-Id: I9a9d8d33b34273a477f2a9dbcf092887dcbc91c0
2014-11-05 13:26:19 -08:00
Adam Lesinski
69ecfa9034 Merge "Add error checking to aapt for split generation" into lmp-mr1-dev 2014-11-05 19:15:57 +00:00
Adam Lesinski
a7d1d73a47 Implement back-tracking when searching for attributes in XML or resource bag
Shared libraries have their package ID assigned at run-time, so some
of the guarantees we used to have about sort order of attributes in
bags or XML elements no longer hold.

This CL adds back-tracking and can jump to the nearest attribute with the
same package ID and continue searching.

This means that attributes with the same package ID must be sorted by increasing
resource ID, as was the case before.

Attributes with the same package ID must be grouped together, but the groups can
be in any order. Ex: 0x02010001, 0x02010002, 0x01010000, 0x01010010, 0x7f010032

Bug:17666947
Change-Id: I9c198bbb6ca788849aac85b6323606ea5d9550d6
2014-11-04 16:34:34 -08:00