7147 Commits

Author SHA1 Message Date
John Reck
0b8d0677be Fix copyLayerInto
Bug: 26763945
Change-Id: I21ffbd56cf70bad0928416963e6fc254be435af9
2016-01-29 14:53:45 -08:00
Teng-Hui Zhu
28d4ea5584 Fix redundant drawPath call
Change-Id: I17dab39e0ca60f64543053381d8677f1a31507c0
2016-01-28 10:32:35 -08:00
Teng-Hui Zhu
dbee9bb342 Gradient for VectorDrawable's fill and stroke
Add ComplexColor interface for both GradientColor and ColorStateList.
Set up constant state, factory, theme attrs for GradientColor, while
refactoring the ColorStateList's similar code. (Functionality in CSL should
be the same).

Support themeing in both the root and item level in GradientColor.
For example, both startColor in <gradient> tag or color in <item> tag can
have theme color.
Add tests for both simple and complex cases with themeing etc.

Hook up the native VectorDrawable implementation using 2 extra JNI calls for
simplicity. Such calls only happen at inflate and applyTheme call.

b/22564318

Change-Id: Ibdc564ddb4a7ee0133c6141c4784782f0c93ce0e
2016-01-27 16:32:42 -08:00
Chong Zhang
c3bd568112 Restore code to draw backdrop and content nodes
bug: 26626661
Change-Id: I9e4dd41708e8ed93d3cf64242ad81815a653d269
2016-01-26 12:49:28 -08:00
John Reck
c9fd313f94 Merge "Fix tests" 2016-01-26 18:59:27 +00:00
John Reck
65182ccffc Fix tests
Disable FrameBuilder.clippedMerging as it relies on
merged bitmap ops which was disabled in b/26793764

Fix Buffer to correctly initialize mRefs count

Change-Id: I87d2fcc690a2ae14eaf751f650f522be5b622edf
2016-01-26 10:50:10 -08:00
John Reck
5f1c64ef76 Merge "Temporarily workaround merged bitmap bug" 2016-01-26 18:06:04 +00:00
John Reck
14de0415bb Temporarily workaround merged bitmap bug
Bug: 26569206

Merged bitmap ops are buggy, just turn them off for
now to unblock testing

Change-Id: Ic0151bb3f23b1843107806659a64b26fd6d6e19e
2016-01-26 09:01:30 -08:00
Florin Malita
dd93728b46 Merge "Add internal Canvas save flags" 2016-01-26 17:00:37 +00:00
John Reck
c52ac0b9e2 Merge "Add fine-grained debug layer" 2016-01-26 15:21:07 +00:00
John Reck
975591a7af Add fine-grained debug layer
Full GLES error checking layer via -include
trickery. Change DEBUG_OPENGL to a level system.

HIGH = every GL call is error checked
MODERATE = checkpointing at interesting spots
LOW = only asserts there are no errors at the end of a frame
 or when the FBO changes
NONE = AIN'T GOT NO TIME FOR ERRORS GOTTA GO FAST!

Change-Id: Ibe81aae93d942059c4ddf1cbb11c828b7ce4c10b
2016-01-25 16:15:14 -08:00
Florin Malita
eecff56fed Add internal Canvas save flags
Skia's SkCanvas::SaveFlags are being deprecated.  This CL introduces
the equivalent android::SaveFlags, converts all internal clients to
the new enum, and switches the saveLayer glue to the
SaveLayerRec-based API.

Change-Id: Icb1785f4e7c0f652b1f04b34a1e3ccb063c408f3
2016-01-25 15:48:00 -05:00
John Reck
83b09fb919 Merge "Validate Region.orSelf arguments" 2016-01-25 18:45:15 +00:00
John Reck
25f0dc440d Validate Region.orSelf arguments
Bug: 26611248

libui.so has int overflow sanitization enable, so
validate that we have "reasonable" looking floats
before trying to orSelf the Region.

Change-Id: I135ef7be82e7abaa9aa569224c2799612847cd03
2016-01-25 10:37:52 -08:00
Andres Morales
214a137209 Merge "expose hwui frame stats through FrameStatsObserver" 2016-01-25 16:51:14 +00:00
Derek Sollenberger
a3f16d4377 Replace SkALWAYSBREAK with equivalent Android macros.
Change-Id: Icb7786c789915375d7d8754fc8536302c1020858
2016-01-25 10:33:01 -05:00
Andres Morales
06f5bc70a6 expose hwui frame stats through FrameStatsObserver
Change-Id: I88884bafc8e2f6d7f67a36d3609490e83cf8afd5
2016-01-22 12:58:51 -08:00
John Reck
541b193fc4 Merge "Fix mismatch in assumed defaults vs. actual defaults" 2016-01-22 19:18:54 +00:00
John Reck
a5b2029e1b Merge "Fix accidental activateTexture(0)" 2016-01-22 19:18:43 +00:00
John Reck
48247a2956 Fix mismatch in assumed defaults vs. actual defaults
Bug: 26584230
Change-Id: Ia0271b097a40123c18f6b3540c1168cba109b5ce
2016-01-22 11:10:32 -08:00
John Reck
bd41ded590 Fix accidental activateTexture(0)
Bug: 26584230

activateTexture(0) was accidentally refactored into
Texture::upload. Only OffscreenBuffer intended for the
texture unit to change

Change-Id: I5dbfc3eab8843733084ce1ce38a0a946abf0e05b
2016-01-22 09:31:28 -08:00
John Reck
1a2d84acbd ALOGE is not ALOGV
Change-Id: I973cd7ce28bed38934aab0818e581a948a12cb42
2016-01-22 09:17:41 -08:00
Derek Sollenberger
a83c1e545e Merge "Add support for bitmaps with Grey_8 color type." 2016-01-22 14:07:37 +00:00
John Reck
c080f112b5 Merge "resolve merge conflicts of 32a95af029 to master." 2016-01-22 00:46:34 +00:00
John Reck
e5530ec0b4 resolve merge conflicts of 32a95af029 to master.
Change-Id: I35b7cea1d34cb24f431ba2b76433a5b0ef1cb602
2016-01-21 16:45:31 -08:00
Michael Wright
6cfa1cc4b0 Merge "Add choreographer API to the NDK." 2016-01-22 00:31:40 +00:00
Michael Wright
3d3fe5026a Add choreographer API to the NDK.
Change-Id: Icb8cffd3cd3bd06814466be72db3e26f6a62cbc6
2016-01-21 16:30:33 -08:00
Roozbeh Pournader
2d05094209 Merge "Implement smarter locale resource selection" 2016-01-21 22:17:31 +00:00
John Reck
32a95af029 Merge "libhwui: fix texture memory leak"
am: 550d46d9da

* commit '550d46d9dae8a4de5abd36a5e2d3c101135da696':
  libhwui: fix texture memory leak
2016-01-21 22:08:44 +00:00
Doris Liu
7f193c5b03 Merge "Create SkCanvas on the stack to avoid leaking memeory" 2016-01-21 21:49:54 +00:00
Roozbeh Pournader
b927c559e1 Implement smarter locale resource selection
* Add support for determining script from language and region.
* Add support for determining special parents of locales.
* Add support for smart comparison of locales with only a difference
  in region, using the locale parentage tree.
* Fix LocaleData.matchScore() to not fallback to old locale matching
  behavior if we can't determine a script.
* Allow four-character variant codes. (Previously, only five- to
  eight-character variant codes were allowed.)

Bug: 7296673
Bug: 26589793
Change-Id: Ibde0a48c0564ff383b41068095a5cbacfe7b94bc
2016-01-21 13:47:22 -08:00
Doris Liu
c2de46fadd Create SkCanvas on the stack to avoid leaking memeory
Bug: 26447978
Change-Id: Ied022c103c3b08e9cfc3cb775a8c95fd5461e81d
2016-01-21 13:05:48 -08:00
John Reck
66f65cb345 Ensure Texture always binds to self
Bug: 26584230

In the event that Texture decides it doesn't
need to actually call glTexImage2D/glSubTexImage2D
it needs to still activateTexture(0) and bindTexture(mId)
as this is the expected state after Texture::upload()
is called.

Change-Id: I62d689a9057907a10dda2bc8f40c3113e43b93b2
2016-01-21 09:08:42 -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
John Reck
2de7771740 Normalize GL_UNPACK_ALIGNMENT
Several places were setting GL_UNPACK_ALIGNMENT
unneccessarily, whereas other places were assuming an
unpack alignment of 1. Since we never actually
do explicit row-alignment, set GL_UNPACK_ALIGNMENT
to 1 at context creation time and never change it

Bug: 26584230

Also turns on aggressive glGetError checking to
better catch potential problem zones

Change-Id: I190c8f0f0494a7f046d5ed769405c75d363be59a
2016-01-20 13:16:24 -08:00
Derek Sollenberger
88d842fedf Add support for bitmaps with Grey_8 color type.
bug: 26679788
Change-Id: Ib5524e3e204e1478461c7371c411e96285feb9c7
2016-01-20 10:48:55 -05:00
John Reck
dcdbba7c95 Re-enable new pipeline
Change-Id: I0d0b2a109a3756d404e4e244348a863a9afa3f9b
2016-01-19 13:57:48 -08:00
John Reck
0c540849d7 Merge "Fix ordering of texture->upload arguments" 2016-01-19 21:21:33 +00:00
John Reck
9372ac3621 Fix ordering of texture->upload arguments
Caught by scatter-shotting GL_CHECKPOINTS which
seem generally useful to have

Bug: 26609444

Change-Id: Ie31d9297d8dae56405126720f338b4256c8bae77
2016-01-19 12:58:48 -08:00
John Reck
465eefb9f3 Merge "fix race condition between HWUI cache and renderThread" am: 2c2b5e8514
am: 4354ae9883

* commit '4354ae9883ae1282ac457539f46d529bdfa89fec':
  fix race condition between HWUI cache and renderThread
2016-01-19 18:42:21 +00:00
John Reck
4354ae9883 Merge "fix race condition between HWUI cache and renderThread"
am: 2c2b5e8514

* commit '2c2b5e8514247d8524778d209f26b7dbde19d142':
  fix race condition between HWUI cache and renderThread
2016-01-19 18:38:11 +00:00
John Reck
1b94f9b77c Revert "Switch to new rendering pipeline"
This reverts commit 3daf4d3272f2cc6ce3b5a572b9d4dcce1654086d.

Temporarily disable due to high rate of crashes from endLayer check

Bug: 26609444
Change-Id: I7583a77bf5cc1e722fa4042db0542f80cd978760
2016-01-19 09:44:39 -08:00
John Reck
7d569db936 Merge "Hard-abort tests if LOG_ALWAYS_FATAL" 2016-01-19 15:38:16 +00: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
John Reck
f1dafb5962 Hard-abort tests if LOG_ALWAYS_FATAL
Bug: 26591625

Also fixes it so debuggerd runs and we get stacks

Change-Id: I55b376e6a4e12ddcd21fa251fbfe5bd521fc0985
2016-01-15 16:58:23 -08:00
John Reck
7db5ffb7db Revert "Revert "Fix leak in unclipped save layer""
This reverts commit a6fc36d4cd7f27147fd304960acdd1d2f47fc1c6.

Change-Id: I6b96afe4a32dc894d5b17cfb870b45063257aed2
2016-01-15 13:59:37 -08:00
Daniel Chapin
a6fc36d4cd Revert "Fix leak in unclipped save layer"
This reverts commit 8e068d5fd38dd103a122215fb6d185135182edf3.

Change-Id: Icd8ad5a2450db34aacecf748d6103df9faaa4c81
2016-01-15 03:02:58 +00:00
John Reck
8e068d5fd3 Fix leak in unclipped save layer
Change-Id: I31f146af2cb6f5cb8dd19bb0feff0ae35b864eba
2016-01-14 16:28:28 -08:00
John Reck
a55b5d6c65 Fix "leak" in FrameBuilder.textureLayer test
DeferredLayerUpdater always did a post to delete itself, which
would result in the test thinking it had leaked an object since
it wasn't deleted when it returned. Fix this by deleting immediately
if we're already on the right thread.

Remove RenderState's requireGlContext assert as it's now
covered by GpuMemoryTracker, which is also more test friendly.
RenderState's assert required an actual EGL context, which we
don't mock away in unit tests.

Change-Id: Ic23eb54e7151355f7acca483d7464350c9d6a87f
2016-01-14 15:09:10 -08:00
John Reck
00159554e0 Fix leak in OffscreenBufferPoolTests
Change-Id: Ic16df75bdc01d902639df98bc6798d9383510342
2016-01-14 14:47:07 -08:00