5142 Commits

Author SHA1 Message Date
Dan Albert
88ba339aef Clean up makefile cruft.
The build system already takes care of all these things.

Change-Id: Idef80b554e07cef5e5ed2adf1b5740a76f13ef6d
2014-09-11 16:21:19 -07:00
Dan Albert
bcaaebb8a8 Merge "Clean up test makefiles." 2014-09-11 23:21:14 +00:00
Dan Albert
715d01aedf Clean up test makefiles.
The build system takes care of linking the correct STL and gtest
libraries for you, and specifying them manually confuses the build
system when using libc++.

Change-Id: I9f76ab26a63ace51293614cfb5ca002f37438e02
2014-09-11 15:49:57 -07:00
Dan Albert
2ffa4aabd7 Merge "Use char16_t for char things." 2014-09-09 04:30:35 +00:00
Dan Albert
be23d47d1c Make string literal concatenation play nice with C++11.
In C++11 mode, "foo"MACRO_THAT_EXPANDS_TO_STRING gets lexed as a user
defined literal. Add space around the macro.

Change-Id: I24fbe1fda483db4a8c606e80dbe17430ad070dc2
2014-09-08 18:38:35 -07:00
Dan Albert
f348c15ecf Use char16_t for char things.
When compiling in C++ mode, the compiler will complain about conversions
from uint16_t to char16_t. Be consistent in using char16_t for strings.

Change-Id: I052b6176ced635162920b31560052d9a64f92764
2014-09-08 18:30:08 -07:00
Piotr Jastrzebski
e2134a4b5d Update ziparchive usage to the new API.
Bug: 16162465

Change-Id: If3064e2be3e7e85366b07434294a7879b0e5f9bc
2014-08-15 14:41:08 +01:00
Piotr Jastrzebski
1a68b079d7 Remove memory leak.
Call EndIteration in endIteration to free memory allocated for cookie in
StartIteration.

Change-Id: I3d58a461c2f3676565cfd7922dc6d8d5c35feae9
2014-08-11 08:20:35 +01:00
Chris Craik
215ecb93e9 Merge "Restore untrusted glStencilMask value on resume after functor" 2014-07-22 20:34:45 +00:00
Chris Craik
c47aba2a77 Restore untrusted glStencilMask value on resume after functor
Fixes an issue where the stencil buffer is corrupted
(used in overdraw debugging, path clipping) when used in
conjunction with a HW accelerated WebView.

bug:15023700
bug:16465551

Change-Id: If201b503931380f7107a34e9a9a2f877a50f72b1
2014-07-22 23:19:02 +00:00
Chris Craik
50a2d6339c Merge "[HWUI] Fix invisible views are still shown in popup window" 2014-07-22 16:35:00 +00:00
Chris Craik
152d9e6128 Merge "[HWUI]: fix residual line on FrameBuffer" 2014-07-17 18:05:27 +00:00
Elliott Hughes
6a4deeda70 Switch frameworks/base/libs/androidfw to the new icu.
Change-Id: Id82830750dd7e83bbc66811a1133b403cc697c97
2014-07-09 16:58:28 -07:00
henry.uh_chen
3a1bffa835 [HWUI] Fix invisible views are still shown in popup window
Symptom: Invisible views are still shown in popup window

Root Cause: glClear isn't called if there is no draw command

Solution: Even if there is no draw command, it still calls glClear
          by startFrame().

Reproduce steps: App set one view in a popup window to invisible,
                 it will be still visible.

Change-Id: I36bc7b752434ad388fbb80ea63341ac778f48d35
2014-07-03 10:14:15 +00:00
henry.uh_chen
20adb6ce4d [HWUI]: fix residual line on FrameBuffer
Symptom: If app applies animation to enlarge a bitmap, there will be an residual
         line on the screen

Root Cause: On platform which has Tile Rendering implementation (ex. Qualcomm
            CPU), startTiling() call will restrict the framebuffer region which
            GPU can affect. So the expansion of clear region by 1 will not take
            effect if startTiling region is not expanded.

Solution: Expand the startTiling region by 1, too.

Reproduce steps: Apply animation to enlarge (and then shrink) a bitmap icon.

Change-Id: I7b4a59e180daa29dbe909d9e11f4093ae1d7396f
2014-07-03 09:58:31 +00:00
Narayan Kamath
fec5106c8e Fix issue when converting fil->tl.
We should call ResourceTable::getLocales directly,
and not AssetManager::getLocales. The latter will convert
"tl" to "fil" so we'll end up thinking we have resources
for "fil" when we don't really have any.

bug: 15873165

Change-Id: I9753e4608aaecede328a40ee1f3ee6b016d0dedc
2014-07-07 09:51:01 +01:00
Narayan Kamath
e4345dbd2a Fall back to "tl" if "fil" is absent.
For JB-MR1, there was a hack that used "tl" where
we really meant "fil" because ICU didn't have localizations
for "fil". This has now been fixed, and we now support 3 letter
language codes for AAPT so we can use "fil" where required.

For the benefit of apps that need to target older platforms,
we fall back to "tl" if the app has assets for "tl" and the
resource locale is "fil".

See bugs 7291355, 7207176 and 8049507 for more context.

Change-Id: I1ac8502525f99b40f9091d5efd2df33518d47a41
2014-07-02 10:53:43 +01:00
Narayan Kamath
b297591622 Fix packing of values at offset 16.
Our bitmask for setting the highest bit to 0 for
0b11100000 (0xef) instead of 0b01111111 (0x7f) so
we would end up setting bit 5 of each offset to
zero. Fix this and expand test coverage by adding
a fake language (tgp) that has this bit set in both
its bytes.

This issue was discovered while adding CTS tests for
"tgl".

Change-Id: Ibb6de03000951c907c252049771039ab7466187a
2014-06-30 16:20:27 +01:00
Narayan Kamath
71dfc7e9ac Merge "Memory leak in parsePackage" 2014-06-24 06:22:45 +00:00
Henrik Baard
5f7ce10c93 Memory leak in parsePackage
The method parsePackage failes to delete some resources
in case of failures.

Added delete of "package" in the cases that was previously
missed.

Change-Id: I183e9ec5864c5ed18bb48410ab41317cb3d96bda
2014-06-23 14:03:46 +02:00
Adam Lesinski
4c488cca53 Merge "[Asset Manager] Fix memory leakage bug" 2014-06-17 05:00:50 +00:00
Chris Craik
0d28bb47d7 Merge "Fix the texture ID reuse issue in HWUI." 2014-06-16 22:13:20 +00:00
Chris Craik
5e7ef9489f Merge "hwui: fix possible null pointer de-refrence" 2014-06-16 22:13:20 +00:00
sean_lu
7c57d23371 [Asset Manager] Fix memory leakage bug
Symptom: memory leakage
Root Cause: new SortedVector but not free it in native cpp
Solution: free the SortedVector
Project: AOSP
Note:

Change-Id: Iab5a7f2e8d8509631301e7231427927d4797c856
2014-06-16 15:11:29 +08:00
jiayuanr
4a473c7d94 Fix the texture ID reuse issue in HWUI.
Issue: When the layer of previous frame is destroyed, it doesn't clear the
texture id in mBoundTextures[mTextureUnit], so in the next frame, if
glGenTexture returns same texture ID of the previous frame,
the new texture is not bound.

CRs-fixed: 671736

Change-Id: Ifc5fd2115fb1863b3c006ab14b0faabeaeb4eab4
2014-06-16 09:29:22 +05:30
Digish Pandya
1fa4cef34a hwui: fix possible null pointer de-refrence
add layer check for  null before de-refrencing it.

issue link: http://code.google.com/p/android/issues/detail?id=61622

Change-Id: I54fc21ec594effcfb1eededd80dd5b0b52645c4c
2014-06-13 17:14:50 +05:30
Lu, Shenghua
c5e0a29541 update parameters in uploadToTexture() for GLES20
Google optimized the uploadToTexture with GLES3.0+,
This allows us to upload a sub-rectangle of texture,
but this has compliance issue with GLES 2.0.

With OpenGL ES 2.0 we need to copy the bitmap in a
temporary buffer if the stride doesn't match the width,
and then upload entire temporary stripes.

Change-Id: I8987cd8347913c61b7fa45bd47be1189aa6bdb05
Signed-off-by: Shenghua Lu <shenghua.lu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Guobin Zhang<guobin.zhang@intel.com>
2014-06-13 09:42:33 +08:00
Chris Craik
4d31c5474b am ce7fa780: Merge "Fix a resource race bug in PathCache"
* commit 'ce7fa780cdee2730b570cc34066f15c74d44e6ef':
  Fix a resource race bug in PathCache
2014-05-30 17:59:51 +00:00
yuyang
7061f7d791 Fix a resource race bug in PathCache
When enabled defer rendering, it will do precache for DrawPathOp.
The paint used for creating PathTask in precache just get the address
of mFilteredPaint of OpenGLRenderer. So for the following defer
operation like DrawTextOp has possibility change the mFilteredPaint
by getPaint while another WorkerThread in PathCache is using the paint
which pointed to the same address of mFilteredPaint to generate bitmap.
As a result, it will generate a wrong bitmap for generateTexture in
PathCache. To fix it, do a copy of paint when creating PathTask.

CRs-Fixed: 664244

Change-Id: I5516f5b143458b88d3573d15b7ebb34f688800c7
2014-05-30 08:26:37 +05:30
Chris Craik
00fabcbeb0 am b1708e9b: Merge "Use alpha channel instead of red in drawCachedGlyphBitmap"
* commit 'b1708e9b764268a06d91219a5c39ee9efd32ab00':
  Use alpha channel instead of red in drawCachedGlyphBitmap
2014-05-19 19:27:52 +00:00
Digish Pandya
c62c1cc17d Use alpha channel instead of red in drawCachedGlyphBitmap
the correct value to copy in bitmap is alpha component from
the cachebuffer. currently it is offset to red channel if format is
RGBA which is wrong.

this is followup fix for https://android-review.googlesource.com/#/c/93943/

Change-Id: I96b5ba35df5ccaef44caf2542d35d6585ba1df80
Signed-off-by: Digish Pandya <digishp@codeaurora.org>
2014-05-15 08:59:22 +05:30
Chris Craik
7e13d1d4a4 am f6c9c420: Merge "Correct stride for drawing to cached glyph bitmap"
* commit 'f6c9c4204c2f8f86277d081112c9dd863ddaa778':
  Correct stride for drawing to cached glyph bitmap
2014-05-09 21:46:43 +00:00
Digish Pandya
b9312a54e4 Correct stride for drawing to cached glyph bitmap
fixes the glyph cachebuffer index to account for pixelbuffer
format size.

issue: in launcher home screen create icon group and rename the
group to some text string with emo-icons (smilies). without this
change the drop shadows for emo-icons will look bad.

Change-Id: I525a9219d35f4541363fd64e7fc5fd1053269725
Signed-off-by: Digish Pandya <digishp@codeaurora.org>
2014-05-09 15:05:16 +05:30
Chris Craik
5d8343b8e2 am a85db5ab: Merge "libhwui: Handle the blurImage() implement once RS::init fail"
* commit 'a85db5ab785c59726c3644999801e48f449714f3':
  libhwui: Handle the blurImage() implement once RS::init fail
2014-05-05 21:46:48 +00:00
Chris Craik
a85db5ab78 Merge "libhwui: Handle the blurImage() implement once RS::init fail" 2014-05-05 21:44:08 +00:00
Bill Yi
293513a59d Merge commit '0b62467b142b61ee1e449ba958ba37dfd961ef56' into HEAD 2014-04-29 16:07:29 -07:00
Lu, Shenghua
ea42e01527 libhwui: Handle the blurImage() implement once RS::init fail
Once the RS::init failed, go through the original single thread path,
this will avoid blocking the main thread(ANR), but we also should have
some implement in RenderScript component.

Change-Id: I3a21395ffd5bc144c15254893f425b1dd2643ba4
Signed-off-by: Shenghua Lu <shenghua.lu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
2014-04-25 16:11:13 +08:00
Ben Cheng
b386bfd791 am 89dddcc9: Merge "Use default visibility for Snapshot::getLocalClip."
* commit '89dddcc948cb3e826bfddeefae73066849aba0fc':
  Use default visibility for Snapshot::getLocalClip.
2014-04-02 20:54:47 +00:00
Ben Cheng
65ba94f79d Use default visibility for Snapshot::getLocalClip.
The method is in libhwui.so but used by libandroid_runtime.so
(via android_view_GLES20Canvas.cpp). If the compiler decides not to
inline this method, the linker won't be able to resolve the dependency
when it has hidden visibility.

The problem is found when testing GCC 4.9.

Change-Id: I3b4d096c7767f0bef0796886dfb2c5ba2ecff48c
2014-04-02 13:26:33 -07:00
Narayan Kamath
eaab4df0dd am cd3f60f3: Merge "AArch64: Make frameworks/base code more portable"
* commit 'cd3f60f30366a34b4499aab5a47b622069ba9cd6':
  AArch64: Make frameworks/base code more portable
2014-03-27 12:36:10 +00:00
Ashok Bhat
f5df700e6c AArch64: Make frameworks/base code more portable
Changes in this patch include

[x] Use %zu for size_t, %zd for ssize_t

[x] Some minor changes have been done to conform with
    standard JNI practice (e.g. use of jint instead of int
    in JNI function prototypes)

Change-Id: Id1aaa7894a7d0b85ac7ecd7b2bfd8cc40374261f
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
2014-03-27 12:30:42 +00:00
Chris Craik
6fe434a41b am 4118480a: am 80470cdf: Merge "Solve three memory leaks related to PatchCache"
* commit '4118480aabb4a7b332e289ebb71d2e4f9bc05d7e':
  Solve three memory leaks related to PatchCache
2014-03-25 20:27:52 +00:00
Chris Craik
4118480aab am 80470cdf: Merge "Solve three memory leaks related to PatchCache"
* commit '80470cdf6c6995f4afe8d5e2c4b6e898625173fb':
  Solve three memory leaks related to PatchCache
2014-03-25 13:21:01 -07:00
Jens Gulin
6056e10271 Solve three memory leaks related to PatchCache
A Patch can be fairly large, holding bitmap data, but
is also frequently leaked which adds to the severity.
The feature is used in many important processes such
as Home, SystemUI and Chrome.

The following leaks are solved:

1. The Patch itself was not always freed.
PatchCache::removeDeferred() can mark patches to be
cared for by PatchCache::clearGarbage(). But
mCache.remove() would only destroy the container
and the pointer, not the Patch object itself.

2. The vertices stored in the Patch at Patch::createMesh()
would always leak. The empty/default destructor in Patch
would not properly destroy "vertices" since it's just a
pointer.

3. A BufferBlock that's added to the mFreeBlocks
in PatchCache could leak. The leak happened when a
patch later needed the entire free block, because the
object was removed from the list but never deleted
in PatchCache::setupMesh().

Change-Id: I41e60824479230b67426fc546d3dbff294c8891f
2014-03-25 09:37:02 +09:00
Leon Scroggins III
2488727a59 Update framework to use M33 Skia. DO NOT MERGE
(These CLs are already in master.)

Bug: 13246311

This cherry-picks 7 CLs:

-----------------------------------------------------------------------

Remove calls to deprecated SkBitmap::setIsOpaque()

setIsOpaque() has been removed from ToT Skia.

Update setters for mIsPremultiplied and hasAlpha to take the
other into consideration.

cherry-pick from: I1b36b0b0ce7126031eb7b769b563c17dcd4b306a

-----------------------------------------------------------------------

Merge AssetStream with AssetStreamAdaptor.

Add enums to the constructor for AssetStreamAdaptor to choose the
different behaviors used by the (former) two different classes.

The old clients of AssetStream now get the following features of
AssetStreamAdaptor
- Debugging statements on error.
- The stream is an SkStreamRewindable.
- getLength() returns the correct value, and the old way of getting
  the length (read(NULL, 0)) is no longer implemented, since it is
  no longer used.
- isAtEnd() returns the correct value. ToT Skia makes it pure virtual,
  so some implementation is necessary.

cherry-pick from: I2a5395914e4f53830aaefee396556459083a1c56

-----------------------------------------------------------------------

Deprecate Android-specific SkPaint functions.

The following functions were problematic:
 const SkGlyph& getUnicharMetrics(SkUnichar, const SkMatrix*);
 const SkGlyph& getGlyphMetrics(uint16_t, const SkMatrix*);
 const void* findImage(const SkGlyph&, const SkMatrix*);

Replacing them with calls through SkGlyphCache solved a nasty crash
bug, so they have all been deprecated.

Bug: 11968757
cherry-pick from: Id746315d41aec5b211b78b172a883c2061130f08

-----------------------------------------------------------------------

pass SkGlyphCache into updateGlyphCache()

Doing so prevents us from double-locking the glyph cache, thereby
effectively locking ourselves out of reusing work that we'd just done.

Bug: 11968757
cherry-pick from: I5c552f2d0bbe30af2ce9054ba684e7da756a0d89

-----------------------------------------------------------------------

Updates to the Skia API needed to merge the WebView m33 version of Skia.

cherry-pick from: I0f63b53f2aae58871413b132742fc84138f069a3

Bugfix for screenshots (recent apps) due to incorrect rowBytes computation

bug: 12915192
cherry-pick from: I4d5fe2a2f75baf66099e0970fb646686a1992714

-----------------------------------------------------------------------

Fix bug in AndroidPixelRef where we did not store the correct imageInfo for a recycled bitmap.

cherry-pick from: I882483b78886e2f19fa4e43a86e69f5a82b3b7e5

-----------------------------------------------------------------------

Change-Id: Icaf597783da3ffb079ea18badb78fa31403bf8b8
2014-03-20 15:38:46 -04:00
Chris Craik
d23d5b192a am 7c9bd98a: am 89513ee5: Merge "Fix projection offset caching - DO NOT MERGE" into klp-dev
* commit '7c9bd98a4bb0aa6954d5f612c197d03f309980f0':
  Fix projection offset caching - DO NOT MERGE
2014-03-20 15:42:24 +00:00
Chris Craik
5d39a77992 Fix projection offset caching - DO NOT MERGE
bug:13214038

Because the caching of projection matrix didn't account for changes in
the offset flag, the flag could be ignored. Now we use both to verify
that the cached matrix can be used.

Change-Id: I193b94eaf0b98f046a6484f0866c3d25048653fd
(cherry picked from commit d04a6b15f74035fd2068f34225825b55e94521f4)
2014-03-19 20:09:04 +00:00
Mark Salyzyn
50fa0bd468 am 9a09a523: am 0b472ae1: Merge "androidfw: resolve 64-bit build issues"
* commit '9a09a5236529962afbaba9893e5eaf72bd6621b4':
  androidfw: resolve 64-bit build issues
2014-03-19 19:47:12 +00:00
Mark Salyzyn
9a09a52365 am 0b472ae1: Merge "androidfw: resolve 64-bit build issues"
* commit '0b472ae13d38dd166a1a35782e028ade85bf2975':
  androidfw: resolve 64-bit build issues
2014-03-19 12:42:15 -07:00
Mark Salyzyn
00adb8685e androidfw: resolve 64-bit build issues
- uid_t/gid_t cast to unsigned long
- unused argument warnings
- tab and space requirements

Change-Id: Ib446d8165b9082be02edb55e6b71fd1a03ea3431
2014-03-19 11:11:14 -07:00