1238 Commits

Author SHA1 Message Date
ztenghui
50ecf849cb Create one hole inside the umbra area to avoid overdraw.
bug:13439450

Change-Id: I859575196bd5a3029f447883025a6ec3a1f1face
2014-03-17 10:10:02 -07:00
Leon Scroggins III
7e6fe28b12 am 96978ee2: am f8d8777d: Update framework to use M33 Skia. DO NOT MERGE
* commit '96978ee290ea0ef666c49ffa8733a8c74304c9f1':
  Update framework to use M33 Skia. DO NOT MERGE
2014-03-17 15:58:32 +00:00
Leon Scroggins III
96978ee290 am f8d8777d: Update framework to use M33 Skia. DO NOT MERGE
* commit 'f8d8777dddf91c741981b4f795f2fb2b1d81c1b6':
  Update framework to use M33 Skia. DO NOT MERGE
2014-03-17 15:55:43 +00:00
Leon Scroggins III
f8d8777ddd 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: Ie2b731a9f0795802418cfecddb4b684c92c64d33

Conflicts:
	core/jni/android/graphics/Bitmap.cpp
	core/jni/android/graphics/Graphics.cpp
	core/jni/android/graphics/Typeface.cpp
	graphics/java/android/graphics/Bitmap.java
2014-03-17 13:57:18 +00:00
John Reck
acb6f07623 Split out RenderProperties
Change-Id: Ia9888b4fb2c849d95a8c395cafef2e2294a23aae
2014-03-12 23:32:24 +00:00
John Reck
33896588e8 No-op isolatedZVolumen property
Change-Id: I7aa474d65a3d12efd4ffb731e07ee42f4d348183
2014-03-12 15:14:12 -07:00
John Reck
361fd3d2ff Merge "Rename DisplayList->RenderNode" 2014-03-12 21:03:03 +00:00
John Reck
e18264b079 Rename DisplayList->RenderNode
Change-Id: Id42e23c9a1a6eb6eaeafef707ced7fa6887b03d0
2014-03-12 13:56:30 -07:00
Chris Craik
b98f2116f5 Force shadow casters above the Z=0 plane
Change-Id: Ifee75414829d4bfb3c7aa6219f1f9bcfd50ff0c6
2014-03-12 11:19:42 -07:00
Chris Craik
b79a3e301a Fix orthographic shadows projection, simplify shadow reordering
Separate matrix passed to shadow system into two parts, one for
transforming the polygon XY points (using the actual draw matrix) and
a separate one which respects correct 4x4 3d rotations and
translations for determining Z values.

Change-Id: I7e30a84774a8709df6b2241e8f51fc5583648fe8
2014-03-12 09:44:41 -07:00
Chris Craik
e361ad7ab1 Remove experimental perspective projection
Change-Id: Iad688c8395ccd4673cc129973802b5f01dfb45ba
2014-03-11 15:41:40 -07:00
Chris Craik
726118b352 Improve shadow tessellation performance
- Tune and simplify shadow parameters
- Remove additional inner rings
- Improve polygon ray casting algorithm

Change-Id: If0f28b2d66ae0480b675942bb65e8fcd2864425d
2014-03-11 15:23:36 -07:00
John Reck
be34f2f3b3 DisplayList lifecycle changes
Bug: 13360343
 Change DisplayList to be more forgiving with weaker lifecycle
 requirements. Is more self-managed with a strong reference
 to the renderer it needs

 Also fix naming mismatch

Change-Id: I5c89453a72a52954f6f959f0846199705dbb6476
2014-03-10 10:12:32 -07:00
Narayan Kamath
b5c4e7fd38 resolved conflicts for merge of 92860a74 to master
Change-Id: I3036ef9f1251c756092dc5ee2c4fed8146855e1e
2014-03-10 10:57:05 +00:00
Narayan Kamath
92860a74c6 am 8272c84c: am bbf82665: am 6e2fb587: Merge "LP64: Make 9 patches architecture agnostic."
* commit '8272c84cb531a4f148f0b0a31d8359d381137378':
  LP64: Make 9 patches architecture agnostic.
2014-03-10 10:51:11 +00:00
Narayan Kamath
bbf826659e am 6e2fb587: Merge "LP64: Make 9 patches architecture agnostic."
* commit '6e2fb587d71631bd29fdb844a6451d68e2144337':
  LP64: Make 9 patches architecture agnostic.
2014-03-10 03:46:07 -07:00
Narayan Kamath
6381dd4ff2 LP64: Make 9 patches architecture agnostic.
The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.

These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.

Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.

This change also removed the unused patch_equals function
from aapt's Image.cpp.

Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
2014-03-10 10:00:02 +00:00
Chris Craik
9edb96b533 Merge "Update tessellation tracing" 2014-03-07 23:12:32 +00:00
Chris Craik
87f9df880e Update tessellation tracing
Change-Id: I6c73f2467817412d9936dde217df9938a6884003
2014-03-07 14:34:55 -08:00
John Reck
a88bdf8d46 Make sure we register functor count
Bug: 13339664

Change-Id: Iafb8ba77bdf1d971c1d0a345ff525e7f7fa80352
2014-03-06 16:22:47 -08:00
Chris Craik
ef8c07c86f Merge "Draw shadows from casters together if the Z values are similar" 2014-03-06 17:45:29 +00:00
Leon Scroggins III
5e49b497ae 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: Ie2b731a9f0795802418cfecddb4b684c92c64d33
2014-03-06 12:14:47 -05:00
Chris Craik
eea6ef9c76 Fix warnings in hwui
Change-Id: I6ad6b78531cc0426dc2ea82a32775f7b0265b5b1
2014-03-05 16:37:35 -08:00
Chris Craik
8b6f2df48e Draw shadows from casters together if the Z values are similar
Change-Id: Ib5d00c83e81d9d4c384685a84988a681da8b4490
2014-03-05 16:25:50 -08:00
John Reck
44fd8d24f7 DisplayList overhaul
Change-Id: I53418d580c98f706e971545cff81b9921c12cc5f
2014-03-04 15:18:16 -08:00
Chris Craik
6786252405 Fix use of Skia deprecated methods
Change-Id: Ib89c20fc94bcce29b7490d6f55c73492735befda
2014-02-28 12:26:34 -08:00
Chris Craik
da3f525759 Merge "Fix TextureView texture filtering." 2014-02-27 22:20:31 +00:00
Derek Sollenberger
950fe8f8d4 Cleanup unnecessary includes for libskia.
The libskia target exports all of its public includes directories so
redefining them here is redundant. Also this cleans up and makes it
obvious where the framework is making using of private Skia headers.

Change-Id: Ie7ecc9ddd3df780bed6b9af54ba58ca58274e043
2014-02-27 16:21:24 +00:00
Chris Craik
f85da42512 Fix build - DO NOT MERGE
Change-Id: I1ab7c369082d1d2aa4f4ed11354c13ff86582410
2014-02-26 13:21:41 -08:00
Chris Craik
300bdfa13d am 328b7ee6: am aecb8c43: am 7b4cce68: am c3bac8a0: Merge "Fix graphics corruption caused by HWUI caches"
* commit '328b7ee6a2ba2dc8f162fa57dbafd4bfc89bb72e':
  Fix graphics corruption caused by HWUI caches
2014-02-26 19:31:16 +00:00
Chris Craik
2c42b79c6c Fix AOSP build - DO NOT MERGE
Change-Id: I42b420c2ce89ce364a2809b28b827964e6923fa1
2014-02-26 10:44:50 -08:00
Sangkyu Lee
36fad8f6fc Fix graphics corruption caused by HWUI caches
Some caches(PatchCache, TextureCache, PathCache) for HWUI
uses deferred removal for their cache entries even though
actual resource objects are immediately freed by
ResourceCache.
For this reason, the uniqueness of a resource address in
the caches is not guaranteed in specific cases.
(Because malloc() can return the same address when malloc()
and free() called very frequently.)

So it can be possible the cache have two cache entries for
two different resources but the same memory address.
(Of course one of the resources is already freed.)
It also can be possible mGarbage vector in PatchCache has
duplicated addresses and this can lead to duplicated free
blocks in the free block list and graphics corruption.
(Deferred removal was implmeneted based on an assumption of
unique resource addresses.)

So this patch makes sure resource objects are freed after
the resources are removed from the caches to guarantee
the uniqueness of a resource address and prevent graphics
corruption.

Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
2014-02-26 10:43:26 -08:00
Chris Craik
9757ac0b9d Fix TextureView texture filtering.
bug:11748993

TextureView should always be drawn with linear filtering if drawing a
buffer sized differently from the layer.

This fixes a bug where TextureViews that were sized differently from
their contents wouldn't be drawn with texture filtering, causing
visible scaling artifacts.

Change-Id: I8a5d27452fe7269ec53896992f37cff51e3ce15a
2014-02-25 18:50:17 -08:00
ztenghui
8198c3a8f5 Merge "Use pre-computed index to draw the shadow." 2014-02-25 23:20:06 +00:00
ztenghui
63d41abb40 Use pre-computed index to draw the shadow.
Also draw the umbra part as triangle fans instead of zig zag fashion.

b/12840179

Change-Id: Iaa5d15e77351acdd71f076bd8f9bb2d4d2b92faf
2014-02-25 14:18:25 -08:00
Chris Craik
919e95cc23 Modulate shadow alpha by caster alpha
Change-Id: Ibc4b3958feb3b5dba91d30af470d76555a6209c8
2014-02-21 17:15:12 -08:00
Narayan Kamath
35eeb2d859 am 61910447: am 7942397b: am 19256340: am 22c66639: Merge "Fixes for 64bit in libhwui"
* commit '6191044729b2dace9c9b4b15b19a8839377d8973':
  Fixes for 64bit in libhwui
2014-02-21 16:58:28 +00:00
Narayan Kamath
22c6663909 Merge "Fixes for 64bit in libhwui" 2014-02-21 14:23:57 +00:00
Narayan Kamath
2fb1fa6c88 Merge "AArch64: Make AssetAtlasService 64-bit compatible" 2014-02-21 14:15:44 +00:00
Kévin PETIT
73fc558e44 Fixes for 64bit in libhwui
Using reinterpret_cast allows conversions between pointer types
and integers which don't have the same size. The corresponding
flags is -Wint-to-pointer-cast.

Change-Id: I8ff0c79d235fa6d07b8d9305edc185d946d5133d
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
2014-02-21 13:07:29 +00:00
Ashok Bhat
17ab38f8a8 AArch64: Make AssetAtlasService 64-bit compatible
Changes in this patch include

[x] Long(64-bit) is used to store native pointers in
    AssetAtlasService and related classes as they can be 64-bit.

[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)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>

(cherry-picked from 4de3f481bc59ab4b766dc027e41aff7cda9d62f7)

Change-Id: If22daf40eef46f8df9f94d65ddcc52c45b3acf2a
2014-02-21 13:02:34 +00:00
Derek Sollenberger
674554fc36 Reapply "Refactor setting an SkPaint onto a hwui Layer."
This reverts commit 90d0c75e94a32fb7d993fae69762820aabc2fcbb.

Change-Id: Ie807761231edf7c848b019931dccbf466208c0be
2014-02-20 16:20:33 -05:00
Ashok Bhat
4de3f481bc AArch64: Make AssetAtlasService 64-bit compatible
Changes in this patch include

[x] Long(64-bit) is used to store native pointers in
    AssetAtlasService and related classes as they can be 64-bit.

[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: Ib4c77c134e3ad5b21732e20cde9a54a0b16bdab1
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-20 12:10:24 +00:00
John Reck
5efe5a2d35 Merge "Support HardwareLayers in RenderThread" 2014-02-19 18:58:18 +00:00
John Reck
19b6bcfd83 Support HardwareLayers in RenderThread
Also has a few HardwareLayer lifecycle fixes

Change-Id: I6308cb05f8f199eed72189ace768013a46815941
2014-02-19 10:47:19 -08:00
Chris Craik
66d792b663 Merge "Make outline and shadow APIs public" 2014-02-19 18:11:46 +00:00
Chris Craik
e9b8817bd7 Make outline and shadow APIs public
Change-Id: If40dc27b2fdc41c3ed355bc9029474b1344c1a03
2014-02-18 16:55:45 -08:00
ztenghui
146a1f0cbc Merge "Separate spot and ambient shadow strength setting" 2014-02-19 00:07:28 +00:00
John Reck
a39dd59579 Refcounting is hard
Bug: 12994941

Change-Id: I6285ff818fc696dbe504174b98a54cb1d00b445c
2014-02-14 16:59:37 -08:00
ztenghui
ef94c6f88f Separate spot and ambient shadow strength setting
Change-Id: I4530e618b09a7f44b5382f8a40646c0ebf5f214c
2014-02-13 17:09:45 -08:00