6778 Commits

Author SHA1 Message Date
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
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
2fa54ef232 recvfrom takes a non-const pointer.
Change-Id: Ib2c8f2710cb333904106f849f492c83697fdd937
2016-08-12 10:53:48 -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
Treehugger Robot
3f67a1855e Merge "Fix random crash in libhwui" 2016-08-05 18:23:14 +00: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
Treehugger Robot
cf81fdb37b Merge "DisplayEventDisplatcher: Quiet down dispatcher Vsync pulse messages" 2016-06-20 18:44:17 +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
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
Treehugger Robot
c49d21f9c4 Merge "Fix misc-macro-parentheses warnings in common_time." 2016-05-24 19:39:17 +00:00
Adam Lesinski
6f4b566169 Merge "Fix misc-macro-parentheses warnings in aapt and androidfw." 2016-05-19 23:25:09 +00:00
Chih-Hung Hsieh
cef190de85 Fix misc-macro-parentheses warnings in hwui and graphic jni.
Bug: 28705665
Change-Id: I7d1eb38a713fe6cc7f41a3cc3f2f9d0aa0114b2c
2016-05-19 15:25:50 -07:00
Chih-Hung Hsieh
2bd7a3efc4 Fix misc-macro-parentheses warnings in common_time.
Bug: 28705665
Change-Id: Ibdab4631f0e692b8a291faecdeb4a6062f906ea5
2016-05-19 15:21:42 -07:00
Chih-Hung Hsieh
e819d01e3e Fix misc-macro-parentheses warnings in aapt and androidfw.
Bug: 28705665
Change-Id: Iac353e66718aadad384183cf300330695df25909
2016-05-19 15:19:22 -07:00
Chih-hung Hsieh
6e35557ad3 Merge "Fix google-explicit-constructor warnings." 2016-04-28 18:47:00 +00:00
Shammi Khattar
1ead474f61 ZipUtils: Fix wrong timestamps when getEntryInfo
"tm_mon" format should align with "ZipEntry::setModWhen" in aapt.
"tm_isdst" should be initialized, or it will because random value
and cause error in function mktime().

BUG:28021145
Change-Id: I1e8d5c14e5d7b875bf9cd940cb7f4c5b93a1bcd6
2016-04-28 12:13:16 +00:00
Chih-Hung Hsieh
c6baf563ba Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: Ibdd6a210bb7ff228e3624cc319169f77aca3b51e
2016-04-27 11:38:12 -07:00
Christopher Wiley
1e06bde16e libstorage needs libbinder include paths
This library is almost all binder related.  It should be
using libbinder's published include path.

Bug: 27804373
Test: This library compiles with a slightly modified libbinder include
      path.

Change-Id: Ib8e00b59604cdda69ec36cf1c90150b4b9033879
2016-04-14 10:16:33 -07:00
Michael Wright
63c168acf7 Add choreographer API to the NDK.
Change-Id: Icb8cffd3cd3bd06814466be72db3e26f6a62cbc6
2016-04-08 16:55:02 +02:00
Dan Austin
71831a6303 Address const issues in preparation for libcxx rebase.
Change-Id: Ia9edf466ab4d1b6cc3f6c6ed86b333e6521c528d
2016-03-28 13:33:11 -07:00
George Burgess IV
aca700435a Merge "Cleanup uses of sprintf so we can deprecate it."
am: 5a3ac10568

* commit '5a3ac10568e5d729d604c90117550f253ba4b080':
  Cleanup uses of sprintf so we can deprecate it.
2016-03-07 22:56:12 +00:00
George Burgess IV
a346f5458a Cleanup uses of sprintf so we can deprecate it.
Change-Id: Ic66abfb547cd5551c47e03d604e65f83c84c597f
2016-03-02 13:34:44 -08:00
Bill Yi
2528fcdfbd Merge commit '26ada7e78993241d702a908eae93d174cbb3c8b3' into HEAD
Change-Id: Ifc45930160cf01ee78ecfbfdc48697055f82e0a7
2016-02-17 11:38:55 -08:00
Zhang Dongsheng
892760008f libhwui: handle eglSwapBuffers with EGL_BAD_NATIVE_WINDOW error case
If eglSwapBuffers is called but the under surface was destroyed,
the EGL_BAD_NATIVE_WINDOW error may also be generated according
to the EGL spec 1.4.

This really shouldn't happen from the upper, but add the graceful
handling of this case also.

Change-Id: Ic0a599808b72f401d2a01c3dc40f9e6ea0e0a564
Signed-off-by: Zhang Dongsheng <dongsheng.zhang@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2016-02-02 10:39:49 +08:00
Dohyun Lee
c5a3efd286 libhwui: fix texture memory leak
When there is not enough space and we cannot delete any
Texture in TextureCache to secure space, a new Texture is
created over and over again for the same SkBitmap and
there is the case that it is not deleted.
This patch avoids such cases.

Change-Id: Ic5353995e6d0716c31fe3bb49c60ec1a71574643
Signed-off-by: Dohyun Lee <leedhyun11@gmail.com>
2016-01-21 13:46:21 +09:00
Thomas Buhot
c0a0e1a66d fix race condition between HWUI cache and renderThread
getMaximumBitmapWidth() and getMaximumBitmapHeight() of DisplayListCanvas
need HWUI cache instance. Since the initialization of the cache is
asynchronous it may crash if not yet ready. Add a staticFence() call
to guarantee the cache has been created prior issuing the call.

Change-Id: I5ed9e5cc084444c8d1872a77fef50e294ae14e93
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2016-01-19 15:00:42 +08:00
Matthew Bouyack
099bd9ca8f Merge "In CanvasContext::doFrame, make a separate call to computeFrameTimeNanos and save the result. Then pass that value to UiFrameInfoBuilder::setVsync as both arguments." into cw-e-dev am: eebf168e43 am: e0845e8629
am: 6222bb0f6a

* commit '6222bb0f6a772c8fa1dc402740399b0ad1017520':
  In CanvasContext::doFrame, make a separate call to computeFrameTimeNanos and save the result. Then pass that value to UiFrameInfoBuilder::setVsync as both arguments.
2016-01-12 22:45:49 +00:00
Matthew Bouyack
7f667e7a08 In CanvasContext::doFrame, make a separate call to computeFrameTimeNanos
and save the result. Then pass that value to
UiFrameInfoBuilder::setVsync as both arguments.

The order of function argument evaluation is undefined in C++. Because
the value returned from TimeLord::latestVsync may be changed by
the preceding call to TimeLord::computeFrameTimeNanos the values of the
arguments passed to UiFrameInfoBuilder::setVsync is also undefined. This
change removes any ambiguity.

Change-Id: Ie71ee453f9ccc725edfe5f7cc9b277f2a809dfdc
2016-01-12 12:01:48 -08:00
Nick Kralevich
a87b9287a4 Merge "common_time_server.cpp: more O_CLOEXEC"
am: 78d5f90d98

* commit '78d5f90d98365987937b680862c4d88f3beaa4a3':
  common_time_server.cpp: more O_CLOEXEC
2015-12-19 07:08:22 +00:00
Nick Kralevich
a0468e3361 common_time_server.cpp: more O_CLOEXEC
Change-Id: I2185a462d72e11f5a015c525d2d37c52ecc3e430
2015-12-18 20:47:02 -08:00
John Reck
04ce46db64 Merge "libhwui: make setSurface asynchronous"
am: 738a5d4f18

* commit '738a5d4f18e69c03700b77af0ea7e2a101da2c34':
  libhwui: make setSurface asynchronous
2015-12-16 18:44:57 +00:00
John Reck
738a5d4f18 Merge "libhwui: make setSurface asynchronous" 2015-12-16 18:27:24 +00:00
John Reck
f1df0f59c1 Merge "Fix memory leak in HWUI"
am: 85b010b826

* commit '85b010b826129cd1a2090daa533e843b5573aea4':
  Fix memory leak in HWUI
2015-12-11 12:48:28 -08:00
Sangkyu Lee
441cc421b5 Fix memory leak in HWUI
std::unique_ptr::release just releases the ownership of the
managed object. To delete the object, std::unique_ptr::reset
function should be called.

Change-Id: If65f74085b1fc2be3a9fffc433326e0bcdb40ff3
2015-12-11 16:05:10 +09:00
Thomas Buhot
0bcd0cb6b1 libhwui: make setSurface asynchronous
On the critical path of the cold launch of applications
the main thread of the started application tells the RenderThread
to create a surface. This process is synchronous and blocks
the main thread of the application until the creation
of the EGLContext is complete.
As a consequence the launch time of the application is delayed
by time spent allocating the EGL Context in the RenderThread.

With this optimization the launch time of any application
is improved (for example settings by 20 to 40 ms).

Change-Id: Ibf47aaa0abb8dedf7aa00693073db3785d9d6b08
Signed-off-by: Thomas Buhot <thomas.buhot@intel.com>
Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
2015-12-10 14:51:58 +08:00
John Reck
5bb2fdb425 Merge "Fix memory corruption in SpotShadow" am: 8c85c00b5e
am: 8c8353a8c3

* commit '8c8353a8c3152bc3ee4b74815d64c65c2c9d1991':
  Fix memory corruption in SpotShadow
2015-11-11 18:08:15 +00:00
Keith Mok
a1f5631340 Fix memory corruption in SpotShadow
The array list is too small and causing stack corruption

Change-Id: I0e34dad39357fb63977d2ce6f183ced7b6a632be
2015-11-11 08:49:20 -08:00
John Reck
1b85ce17a3 Merge "Fix HWUI Path Cache dangling pointer" am: 37bf3ec9d2
am: 7516d4d866

* commit '7516d4d8667957688433b02b2f4985f1b3ab36ad':
  Fix HWUI Path Cache dangling pointer
2015-11-10 23:31:11 +00:00
John Reck
37bf3ec9d2 Merge "Fix HWUI Path Cache dangling pointer" 2015-11-10 23:20:03 +00:00
Digish Pandya
2e4f67c388 Fix HWUI Path Cache dangling pointer
When precache, PathTexture is added to PathCache, and it is released after drawn if we want to clean it.
But the PathCache LRU still holds the entry of the PathTexture object. When trim the cache in
the end of each frame, LRU finds that its mListener is not NULL and invoke the functor, however,
mListerer points to the released PathTexture object and is a dangling pointer, thus leads to crash.
Smart pointer don't help here since they only manage scopes, while PathTexture is also controled by
its cleanup field.
The fix is to also remove the LRU entry of PathTexture*, it will also release the texture object
and there won't be texture leaks.

Change-Id: Iaa0621df5dc71532e9e75b38ad94384353930b95
2015-11-09 14:22:25 +05:30
Teng-Hui Zhu
83ea5b7b22 When the incoming light source is invalid, don't generate any shadow
b/25417885

Change-Id: I4b87e35ca68091fd0409cb9fe9b9400af860a507
2015-11-05 15:48:35 -08:00
Chris Craik
1c3dd0519a Merge "Revert "Remove -ffast-math from libhwui makefile"" into mnc-dr-dev am: 0cf48e9120 am: 17fc83cbde
am: c06ccd77c1

* commit 'c06ccd77c129cdf198c64babdfd8d289aa8ff908':
  Revert "Remove -ffast-math from libhwui makefile"
2015-11-05 20:37:23 +00:00
Tenghui Zhu
dfaf23f846 Merge "When the incoming light source is invalid, don\'t generate any shadow" into mnc-dr-dev am: 76d20b4a5c am: 1c7fbe0efb
am: d829ab7683

* commit 'd829ab76831a0c323f669385c54f666f8a91e4f1':
  When the incoming light source is invalid, don't generate any shadow
2015-11-05 20:27:43 +00:00
Chris Craik
0cf48e9120 Merge "Revert "Remove -ffast-math from libhwui makefile"" into mnc-dr-dev 2015-11-05 20:21:45 +00:00
Tenghui Zhu
76d20b4a5c Merge "When the incoming light source is invalid, don't generate any shadow" into mnc-dr-dev 2015-11-05 20:05:37 +00:00