7630 Commits

Author SHA1 Message Date
Treehugger Robot
ff5c3ad08b Merge "Fix static analyzer warnings." 2016-10-18 01:30:55 +00:00
Mark Salyzyn
4d6c372eae missing includes
Assumptions are made about header side effects

Test: compile
Bug: 30465923
Change-Id: Icc9415aed5e54b2bc00b70aa0da6df4148f30654
2016-10-17 12:32:54 -07:00
George Burgess IV
e8efec56f0 Fix static analyzer warnings.
frameworks/base/libs/androidfw/ResourceTypes.cpp:742:46: warning: Result
of 'calloc' is converted to a pointer of type 'char16_t *', which is
incompatible with sizeof operand type 'char16_t **'
    mCache = (char16_t**)calloc(mHeader->stringCount,
        sizeof(char16_t**));

frameworks/base/libs/androidfw/ResourceTypes.cpp:4359:28: warning:
Potential leak of memory pointed to by 'set'
     return NO_MEMORY;

Bug: None
Test: Builds without the aforementioned warnings.
Change-Id: I1f84c1b9f4cba05f5cc7c3ae9fec1a07bc9cd8fe
2016-10-13 15:32:33 -07:00
Adam Lesinski
78382db820 Merge "RRO: Synchronize access to overlays.list" 2016-10-12 14:52:49 +00:00
Martin Wallgren
f12af5e907 RRO: Synchronize access to overlays.list
idmap --scan is executed as a part of the pre-loading in ZygoteInit.
The pre loading is executed in parallel for each supported architecture
(32/64 bit). This will cause a race condition in the creation of the
overlays.list file and the idmap files for the system overlays.

Apply flock on overlays.list to prevent the file from being thrown away
and recreated when it is in use by another Zygote.

Bug: 28032298

Change-Id: I51d39f121d207b11181340b68b164b60020f0c61
2016-10-12 15:42:04 +09:00
John Reck
85ddb2df2f Fix SurfaceViewPositionListener race bugs
Bug: 29628138

1: Make windowPositionLost synchronous as that's
what the Java side was expecting

2: Make the listener ref counted as otherwise
there's a race condition with the GC, which could
end up with use-after-frees

3: Ensure that all position updates are invoked
prior to frame completion

Change-Id: Iedbc017f611ba2878a49b4586612f79249ca2fe3
(cherry picked from commit 7b570deea65bc7ac417a26ce3e4103bcef30e957)
2016-10-10 13:36:36 -07:00
Adam Lesinski
126e022095 Merge "[AssetManager]:Fix thread race caused double free issue." 2016-10-03 20:07:37 +00:00
ryang
647bc13709 hwui: Fix the length of partial updates system property
The maximum length of a system property is 31 bytes.
debug.hwui.enable_partial_updates is 33 bytes

Change-Id: Idb1b1a00294dd29f84530e8aee1f685094d0096f
2016-09-26 16:05:06 -04:00
songjinshi
49921f2c05 [AssetManager]:Fix thread race caused double free issue.
The SharedZip's Asset is not thread-safety,the getResourceTableAsset()
and setResourceTableAsset(Asset* asset) function of the SharedZip is
not sync with a same lock.

Consider the following sequence of events:
Thread A calls setResourceTableAsset(Asset* asset),it will set
mResourceTableAsset = asset; then to calls getBuffer() of the asset.
Thread B calls getResourceTableAsset(),which return mResourceTableAsset,
then to calls getBuffer() of the mResourceTableAsset,the asset and
mResourceTableAsset is same one object.
Thread A to delete mZipInflater in getBuffer().
Thread B to delete mZipInflater in getBuffer().

It will cause crash becuase double delete mZipInflater in getBuffer().

https://code.google.com/p/android/issues/detail?id=211941

Change-Id: I5a7d67fdf64c4aa03f505b37a2fa840f4443d158
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
2016-09-20 01:31:19 +00:00
Chih-hung Hsieh
a6b6252d8b Merge "Fix google-explicit-constructor warnings." 2016-09-01 17:33:42 +00:00
Chih-Hung Hsieh
a619ec70cf Fix google-explicit-constructor warnings in libs/hwui.
* Add explicit keyword to conversion constructors,
  or add NOLINT for implicit converters.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Id8ca42433a4fc3652e4cb13787c4cb169f20d9a9
2016-08-29 14:56:58 -07:00
Chih-Hung Hsieh
6d09d547b0 Fix google-explicit-constructor warnings.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Ic550902559b0800bdcfc0b1d301313a909434eed
2016-08-29 14:51:31 -07:00
Chih-Hung Hsieh
474081eee1 Fix misc-macro-parentheses warnings in hwui/tests.
* Add parentheses around macro parameters.
Bug: 28705665

Test: build with WITH_TIDY=1
Change-Id: I04f6dd1a180ed1191bf68b685facf6fb9020b4b0
2016-08-26 15:19:47 -07:00
Sergio Giro
8f7b8a1f6c Unicode: specify destination length in utf8_to_utf16 methods
Change-Id: I5223caa7d42f4582a982609a898a02043265c6d3
2016-08-25 12:04:40 +02:00
John Reck
621fb590e3 resolve merge conflicts of 24e38ab to stage-aosp-master
Change-Id: I02db3eb317ccb182b563ec9350a116bd5de063b6
2016-08-23 15:10:47 -07:00
John Reck
24e38ab322 Merge "Fix native memory leak caused by small HWUI path cache creation" 2016-08-22 21:48:31 +00:00
caiqinl
4b505376cb Fix native memory leak caused by small HWUI path cache creation
HWUI calculates the texture size as w*h*bpp. In some cases, the
calculated path cache is small, but the actual memory allocated
in driver is 4k/8k/16k, much bigger than HWUI calculates.

Example: a 5*65 alpha texture, HWUI think it is 5*65*1 = 325 bytes,
but driver allocates 8K. An app can allocates up to 32M path textures,
which actually consumes 32M*(8*1024/325) = 806M memory.

Here we limit the number of path texture in the cache to 256, it
should be a pretty generous global limit.

Change-Id: I890819b73bb0b7f63e96bc3d9d0ff9469c16838c
2016-08-22 11:22:43 +05:30
Chih-hung Hsieh
9b36ce973e Merge "Fix google-explicit-constructor warnings in common_time."
am: 67d47e0ca6

Change-Id: I2548e50d2654d3dfacd175b4db118983848bf15c
2016-08-17 18:06:22 +00:00
Chih-hung Hsieh
67d47e0ca6 Merge "Fix google-explicit-constructor warnings in common_time." 2016-08-17 17:42:52 +00:00
Chih-Hung Hsieh
ad3dea12ee Fix google-explicit-constructor warnings in common_time.
* Add explicit keyword to conversion constructors.
Bug: 28341362
Test: build with WITH_TIDY=1

Change-Id: Ieab4756042e77cfadda35e34f78f515058ae0bb3
2016-08-15 14:51:48 -07:00
Elliott Hughes
2f4c6e3d0d Merge "recvfrom takes a non-const pointer."
am: 96660b37a1

Change-Id: Ief2e969ec0498ac2c9264fa34a3de36773bc43fa
2016-08-12 19:58:55 +00:00
Elliott Hughes
2fa54ef232 recvfrom takes a non-const pointer.
Change-Id: Ib2c8f2710cb333904106f849f492c83697fdd937
2016-08-12 10:53:48 -07:00
Chih-Hung Hsieh
ed935c32f4 resolve merge conflicts of 76ce8e5 to stage-aosp-master
Change-Id: I4b4ca9906373a95776d2da8ba2fa39a4a78e2a30
2016-08-11 16:48:46 -07:00
Treehugger Robot
76ce8e5242 Merge "Fix clang-tidy warnings in libs/hwui." 2016-08-11 23:20:47 +00:00
Chih-Hung Hsieh
f35c939cd7 Fix clang-tidy warnings in libs/hwui.
* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: Iab3e6636f60a70cb124f29dc19f20f842fa8dfda
Merged-In: Iab3e6636f60a70cb124f29dc19f20f842fa8dfda
2016-08-10 23:26:59 +00:00
Keith Mok
9aaf189103 Merge "Fix random crash in libhwui"
am: 3f67a1855e

Change-Id: I8dfcad3d00b2cca955457142b963934143ec2cbd
2016-08-05 18:37:14 +00:00
Treehugger Robot
3f67a1855e Merge "Fix random crash in libhwui" 2016-08-05 18:23:14 +00:00
Chih-Hung Hsieh
05160d70d1 resolve merge conflicts of 5152fd9 to stage-aosp-master
Change-Id: I2066125eb4076dbc9e8996bb1fa87735aa6040d3
2016-07-21 18:13:31 -07:00
Chih-Hung Hsieh
faecb78a6b Fix google-explicit-constructor warnings in frameworks/base
* Add explicit keyword to conversion constructors.
* Add NOLINT to implicit conversion constructors.

Bug: 28341362
Test: build with clang-tidy
Change-Id: Ie4d37072ab57d1662d18db4de1c8577247f43337
2016-07-21 16:24:06 -07:00
Keith Mok
de89c2fd70 Fix random crash in libhwui
On some cases (noticed from log) that there is a crash in
libhwui.so, future debug log shows that the light center position
values are nan, causing an out of bound access in hull function
in SpotShadow.cpp for parameter retPoly which assume to be of
maximum length of pointsLength only but not the case when all
points are nan.

More log shows that a Snapshot was created (new) without
mRelativeLightCenter begin set, and Layer.cpp trying to
use it by calling updateLightPosFromRenderer. Those values
are random values in stack which causing math calc based on
that value returning nan also.

Initialize mRelativeLightCenter to 0 in Snapshot.cpp to avoid the
problem.

Change-Id: I9e24f6f1f856d053d09db1b1aae100f219f2a6de
2016-07-13 15:20:47 -07:00
John Reck
aecf607eb6 Merge \"Add missing roundOut for layer damage\" into nyc-dev
am: 48cde353eb

Change-Id: If4ca933e218fc33fa78dc063b687e03793635e6c
2016-06-27 22:28:39 +00:00
John Reck
48cde353eb Merge "Add missing roundOut for layer damage" into nyc-dev 2016-06-27 22:22:41 +00:00
John Reck
ac046387be Add missing roundOut for layer damage
fixes: 29771171

This is a regression from HWUI_NEW_OPS, a roundOut
was missing in the new path that was in the old one

Change-Id: Ibf223d550bb5525781864dd9b7f7cd6d73adb98b
2016-06-27 15:18:26 -07:00
Chris Craik
65c0d9d290 Round unclipped saveLayers
am: 45e83338e5

Change-Id: I3ecb7fdd2097779cf7f596c0e6a3f7914902ca39
2016-06-27 21:45:04 +00:00
Chris Craik
45e83338e5 Round unclipped saveLayers
fixes: 29456451

Change-Id: I2be8b47c46936e75071ad0819a718f72b96cbd2b
(cherry picked from commit d5a90114128f4d3d528f1a0e93651496c968f940)
2016-06-27 21:06:35 +00:00
Treehugger Robot
cf81fdb37b Merge "DisplayEventDisplatcher: Quiet down dispatcher Vsync pulse messages" 2016-06-20 18:44:17 +00:00
John Reck
f5159155d0 Merge \"DO NOT MERGE Move SurfaceView offscreen if the app stops drawing it\" into nyc-dev
am: d11b5e6661

Change-Id: I1caf2fbac785c68c6afeb61b60493e728a83a670
2016-06-18 02:14:29 +00:00
TreeHugger Robot
d11b5e6661 Merge "DO NOT MERGE Move SurfaceView offscreen if the app stops drawing it" into nyc-dev 2016-06-18 02:07:05 +00:00
John Reck
cb0649f72b Merge \"Avoid re-calculating vsync mid-frame\" into nyc-dev
am: fc275d244e

Change-Id: Ic46d2d9627c4dcbd345b49f01af0bf3b8247259c
2016-06-18 02:05:17 +00:00
John Reck
501ff9acfe Avoid re-calculating vsync mid-frame
Fixes: 29072773

By using computeFrameTime AnimationContext would
potentially end up modifying the latest vsync if
a very-slow frame was received from the UI thread.

This could potentially desync animations that were
RT & UI thread 'synchronized', but more significantly
it would confuse the swap chain which tries to only
draw one frame per vsync causing unneccessary frame
drops.

Change-Id: Ibd2ec3157ce32fee1eec8d56837c45a35e622895
2016-06-17 20:44:43 +00:00
John Reck
34bf49e4de DO NOT MERGE Move SurfaceView offscreen if the app stops drawing it
Bug: 29360411
Change-Id: Iefb9d7a9dafb34a2b4f79130a2a8b5a7cf7de906
(cherry picked from commit aa6e84f21ddf89ea649a3f00044bc23adfe86978)
2016-06-17 20:26:10 +00:00
John Reck
89132e094f Merge \\"Performance Optimization: Align texture dirty rect\\" am: 4e6a73c16a
am: ec45adde70

Change-Id: Ice5c2f216dab71fe26b07f9299f8c4300b80f665
2016-06-16 21:47:55 +00:00
ywen
ec45adde70 Merge \"Performance Optimization: Align texture dirty rect\"
am: 4e6a73c16a

Change-Id: I2bafdfadd3d6ff88be44475f77158236015acfde
2016-06-16 21:42:13 +00:00
John Reck
4e6a73c16a Merge "Performance Optimization: Align texture dirty rect" 2016-06-16 21:35:12 +00:00
John Stultz
efeda4694b DisplayEventDisplatcher: Quiet down dispatcher Vsync pulse messages
My logcat is packed with these dispatcher vsync pulse messages
that really don't seem to be describing an error case (though
maybe I'm wrong?).

So quiet it down a bit and set the loglevel to verbose.

Change-Id: Ic4359f64f9cecfc1ffe49275f5f63327ba1b6f1d
Signed-off-by: John Stutlz <john.stultz@linaro.org>
2016-06-16 10:24:43 -07:00
Adam Lesinski
c3ab1b7c0a Merge \"ResourcesManager: Allow managed addition of library asset paths\" into nyc-dev
am: 464bda8a2b

Change-Id: I352c56482aca030efab49ca39301679b51e44e05
2016-06-15 22:44:43 +00:00
Adam Lesinski
464bda8a2b Merge "ResourcesManager: Allow managed addition of library asset paths" into nyc-dev 2016-06-15 22:35:26 +00:00
Adam Lesinski
25f48886b2 ResourcesManager: Allow managed addition of library asset paths
This allows WebView to add itself to the ResourcesManager and
remain their even after configuration changes and multi-window
changes.

Bug:29112218
Change-Id: I2cb131ae2c61fb58c48babafdd46c1882be96aa9
2016-06-15 12:00:18 -07:00
ywen
229cad0ab2 Performance Optimization: Align texture dirty rect
Align x offset and width to 32, y offset and height to 4.
It improves the font texture upload performance.

Change-Id: I967eeed90658f2ce1eb08cb2740d5dc34c72f40b
2016-06-15 08:32:25 +00:00
John Reck
f22f6cf0f3 Merge \"Redraw if dirty during stopped when resumed\" into nyc-dev
am: 5b4ff21a74

Change-Id: I75235a18c29939b4f221c8af664d5f7218660aed
2016-06-14 14:54:21 +00:00