2757 Commits

Author SHA1 Message Date
Alan Viverette
2d3ca47ef8 Always update drawable container source res
Bug: 27349209
Change-Id: I3bb3d4862a03fd5ce0beeb2bf5208f2917ec9320
2016-02-25 12:27:02 -05:00
Doris Liu
3005843506 Merge "Support running AVD on UI thread" into nyc-dev 2016-02-23 22:43:53 +00:00
Doris Liu
28cfd20f02 Support running AVD on UI thread
By default, AVD animates on RT thread. But since in some cases there's a
need for a finer control on when the frame update for the animation should
happen, such as coordiating the AVD animation with other animations that
run on UI thread, we are providing a way to force the AVD to run on UI
thread.

Bug: 27278616
Change-Id: I372ecd3dc52e3fa0bdce3a1e9c19443f9b199027
2016-02-23 14:40:47 -08:00
Alan Viverette
921ec44647 Fix NinePatchDrawable handling of density changes
Scaling is now manually applied when the canvas density is not set.

Removes set/getNinePatch accessors that were added in N, since these
are not used and setting the nine patch directly will break padding.
Also removes local NinePatch, which was not necessary.

Bug: 27038114
Change-Id: Ie8b2e485b54d1ed1521081b329a09915fd0a95c1
2016-02-23 14:54:01 -05:00
Doris Liu
c21e8bcb01 Ensure invalidate is called after start()/reverse()
Change-Id: Iec96ada74cc7b845e21b5f0eb208ff7c7b1071ed
2016-02-19 14:35:55 -08:00
Doris Liu
8b083206ae Revert "Revert "Check RenderNode's owning view before attaching animators""
This reverts commit eb40178af3b7c8d925eaf6c1aa0bef739c8ea47e.

Change-Id: I6838ecb35b50847746ee66ac204f14eb5f579b91
2016-02-19 13:52:41 -08:00
Doris Liu
c4bb185d41 VectorDrawable native rendering - Step 5 of MANY
This is reverting the revert of what reverts the revert of the original
implementation. Fourth revert is a charm!

This reverts commit df7fdb1e0bdb5c289bbc08047e5c710185503309.

Change-Id: I6fc3a5accfd8b79c3da31bbc101ad9e9b4d6e7dd
2016-02-19 13:51:31 -08:00
Doris Liu
5b7188aebc Merge "Revert "Revert "Revert "VectorDrawable native rendering - Step 5 of MANY"""" into nyc-dev 2016-02-18 19:06:20 +00:00
Doris Liu
b9fb8fdf78 Merge "Revert "Check RenderNode's owning view before attaching animators"" into nyc-dev 2016-02-18 19:04:28 +00:00
Doris Liu
df7fdb1e0b Revert "Revert "Revert "VectorDrawable native rendering - Step 5 of MANY"""
This reverts commit 0d20a275a5baf8579c8b9111cf2ce6615874a6b6.

Change-Id: I97c782f1164a5d39ab74dc098cca71d9e1b30cd8
2016-02-18 18:37:02 +00:00
Doris Liu
eb40178af3 Revert "Check RenderNode's owning view before attaching animators"
This reverts commit 12abdeb3c7bffbc7c07b913595f6ea2cb66154d1.

Change-Id: I938deddf5f294127f87a0e70f940fe5b9a85e0b2
2016-02-18 18:34:59 +00:00
Doris Liu
e6e57a9d51 Merge "Check RenderNode's owning view before attaching animators" into nyc-dev 2016-02-16 23:38:57 +00:00
Doris Liu
5b49c6f31b Merge "Revert "Revert "VectorDrawable native rendering - Step 5 of MANY""" into nyc-dev 2016-02-16 23:38:43 +00:00
Doris Liu
12abdeb3c7 Check RenderNode's owning view before attaching animators
-Only add animators to a RenderNode when its owning view is attached
-When changing animator's target RenderNode, remove the animator from
 the old target RenderNode that it's currently running on, if any.
Bug: 27141983
Bug: 27145149
Change-Id: I9c9592382d64ecc0390f7ec743a59ce1ad7d9798
2016-02-16 14:25:48 -08:00
George Mount
d86d3fd768 Merge "Set the hover state to the same as focus state in RippleDrawable." into nyc-dev 2016-02-16 15:19:03 +00:00
Doris Liu
0d20a275a5 Revert "Revert "VectorDrawable native rendering - Step 5 of MANY""
This reverts commit e03ef25a3e44ef5d495e366c30b9b5b69fc58194.

Change-Id: I9c2e1c891667451a3ee668e414bf337ad67279ab
2016-02-12 19:49:29 -08:00
Tenghui Zhu
6f1033104d Merge "Fix the CSL theme support inside VectorDrawable's fill and stroke" into nyc-dev 2016-02-12 23:47:27 +00:00
Ben Wagner
fb95699364 Deduplicate font file mappings.
With ttc and gx variation fonts, it is now possible and common that a
number of fonts will use the same font file for data but with different
parameters. In the current code each font will map the font file data,
taking up an unecessary amount of virtual address space and is
inefficient with respect to memory management (like the tlb). This CL
deduplicates these file mappings so that a given font file will only be
mapped into memory once.

DO NOT MERGE
Change-Id: I5ca69f963a434c72ec4028402ecbf9e0f0ee7148
(cherry picked from commit fffcf0a31fd4c9a4ec8aa7de70b1eda0d48fb337)
2016-02-12 19:33:26 +00:00
Teng-Hui Zhu
f7ae8d727b Fix the CSL theme support inside VectorDrawable's fill and stroke
b/26774249

Change-Id: I9a9fcdb0e88c4b46ab86c6b3fd780d40b96024db
(cherry picked from commit 15cc49ae521699b70e3b011768b2ae58a7a9b2fd)
2016-02-12 17:51:20 +00:00
Ben Wagner
a87b07d7fa Add support for gx font variation axes.
This adds an 'axis' child element to the 'font' element. The 'axis'
element has attributes 'tag' (a four byte identifier) and 'stylevalue'
(a float value) to the parser. This also modifies reading the font file
name in a backwards compatible fashion by using only the direct #text
children of the 'font' element. (Both the Minikin and Skia parsers now
allow the font file name on a separate line in the fonts.xml file).

This information is then passed through to Skia in order to select the
desired variation. The Skia parser already parses this way and has for
some time, so Chrome and WebView can already read this format.

Change-Id: I15623fe864fa92b2bf0705af5e389daedfb77e5c
(cherry picked from commit b8e367fb7428076ff2e4aa2a97adaed1ef806e92)
2016-02-12 16:28:35 +00:00
John Reck
e03ef25a3e Revert "VectorDrawable native rendering - Step 5 of MANY"
Bug: 27136799

This reverts commit 18bdf443e371e9f293439b4ff92cc79abaa422e5.

Change-Id: I825b061eec2a591f2d18119ba64494624b9ad4f2
2016-02-11 17:02:33 +00:00
Doris Liu
18bdf443e3 VectorDrawable native rendering - Step 5 of MANY
Implemented reset() (public API for AVD)
and reverse() (internal API that needs to be supported)

Change-Id: Ife1650049f271cad1347943151a5800c40c20aa2
2016-02-11 01:08:47 +00:00
George Mount
e4f976dc3b Set the hover state to the same as focus state in RippleDrawable.
Bug 24810682

There was no hover state for bounded ripples and it was decided
that a solid background color exactly like the focus state
was desired. This change triggers the RippleDrawable to act as
if it is focused when it is hovered.

Change-Id: I94b2a4d03dd4c47fc021c84bb0ba4b4be82f3e95
2016-02-10 07:31:18 -08:00
Jorim Jaggi
7cd1f0d39a Do not invalidate drawable if tint doesn't change
Change-Id: I99d7a679ba3aa4978f2915f1a52f23dbce7fd971
2016-02-09 22:07:32 -08:00
Doris Liu
469a828ac7 Merge "Ref count the nodes in VectorDrawable" 2016-02-05 21:31:24 +00:00
Doris Liu
43a5591c8d Merge "Revert "Revert "VectorDrawable native rendering - Step 4 of MANY""" 2016-02-05 21:31:06 +00:00
Doris Liu
ef062ebd20 Ref count the nodes in VectorDrawable
Also added API check so that for pre-N we ignore invalid VD animation,
in order to avoid breaking old apps.

Bug: 26975469
Bug: 26949340
Change-Id: I498539ad6a05de3d886e7dcdc8a167e78333ab11
2016-02-05 11:12:25 -08:00
Roozbeh Pournader
c9088c5d1b Merge "Various LocaleList cleanups" 2016-02-05 01:38:57 +00:00
Doris Liu
766431aa57 Revert "Revert "VectorDrawable native rendering - Step 4 of MANY""
This reverts commit 5a11e8d0ba21624025b89ac63bbd18befa55be0e.

Change-Id: I7a48b59c4f930dad65ddc8590c25a12636244ea2
2016-02-04 16:29:51 -08:00
Roozbeh Pournader
fee4484637 Various LocaleList cleanups
- Remove the LocaleList#getPrimary() API. It had become confusing
  after locale negotiation was completely implemented. For example,
  it could create the confusion that calling getPrimary() on the
  default locale list would provide the default locale, etc.
- Use the adjusted locale list from LocaleList.getAdjustedDefault()
  in Paints created with no locale list provided.
- Change LocaleList#get() to treat out of bound indexes from both
  negative indexes and too large indexes the same way.

Bug: 26984092
Bug: 26193251
Bug: 26834387
Change-Id: I75f77aea6b75e38793ed8477e5e5a4420d5e6d85
2016-02-04 15:44:03 -08:00
Jorim Jaggi
5bef2fcce8 Merge changes If489d2ba,I1fe12181,Ieb4f586a,Ib51163a0,Ifdfcf3ad, ...
* changes:
  Hide swipe-up gesture behind tuner flag
  When long pressing recents and already docked, undock
  More multi-window fixes
  Use separate flag to suppress resizes
  Only treat "null" bounds as fullscreen
  Exclude stable insets from task config
  Fix bug where surface was not clipped off during resizing
  Fix crash in SysUI when configuration changes
2016-02-04 22:49:52 +00:00
Jorim Jaggi
0a93214198 Exclude stable insets from task config
When a app is in fullscreen, we exclude navigation bar and status bar
size when calculating the config. However, when in multi-window, and
the task was almost fullscreen, the height/width reported to the app
was actually larger than when it was in fullscreen. In order to fix
this, exclude the stable insets when calculating the task
configuration, and also fix a bug when calculating the screen layout.

Change-Id: I843ae012fb3050c79643d125550aacb6e73d27da
2016-02-04 14:36:57 -08:00
Doris Liu
5a11e8d0ba Revert "VectorDrawable native rendering - Step 4 of MANY"
b/26949340 and b/26975469, b/26975079 as well 

This reverts commit f276acd98457bcaabc9e79a17a736b3b484f005e.

Change-Id: I4b55177daf0d289bc03604c71fd4bf579f65073a
2016-02-04 20:59:00 +00:00
Doris Liu
3aaff80f32 Revert "Fix NPE for invalid target exception"
This reverts commit d4fda02dd59adff9553dca5647ebb6c023145d5f.

Change-Id: I73341dc41c7effaa3209107b4e85503b17e2c826
2016-02-04 20:02:52 +00:00
Doris Liu
d4fda02dd5 Fix NPE for invalid target exception
Change-Id: I57b319fae617792351c6ec9872c3b73cd25dc4e5
2016-02-03 11:10:49 -08:00
Doris Liu
a72d52bbed Merge "VectorDrawable native rendering - Step 4 of MANY" 2016-02-03 00:19:22 +00:00
Doris Liu
f276acd984 VectorDrawable native rendering - Step 4 of MANY
This CL runs VectorDrawable animation on RenderThread. The changes in this CL
include:
- Convert all the animators in AnimatorSet for AVD into a set of RenderNodeAnimators.
- Hook up the new animators with RenderThread
- Add drawOp in RecordingCanvas for drawing VD so that during the animation
  on RenderThread, all the property changes on VD can be reflected on the screen.

TODO:
- Implement reverse and reset for AVD.

Change-Id: I2df1d754f2db0ad098d9c15dde4bb2bdfafc2315
2016-02-02 15:04:01 -08:00
Jorim Jaggi
c6c89a8214 Fix transition to recents in docked mode
Transition for non-compatible apps will be handled in a separate CL.

Change-Id: I9c474f7aa394e4f3eacd1845c78bee5874bd8a59
2016-02-01 12:19:53 -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
Chet Haase
f0a7b3b694 Fix problem with zero-duration AnimatedVectorDrawables
There was an issue with some vector drawables, particularly those with more
than one underlying, sequential animators, where the final frame would not be
drawn when battery saver mode was enabled (or animators were set to have durations
of 0). This resulted in an incorrect fingerprint graphic on the lockscreen, because
the animation effectively didn't run at all.

The fix is to always invalidate whenever the AnimatedVectorDrawble draws itself. This
causes us to constantly invalidate() the view while the animation is running.

Issue #26591987 Fingerprint icon displayed as dots when batter saver mode is on

Change-Id: I13cbd71fd229db09418c6dcacfec5a13bbb44b2e
2016-01-26 14:21:53 -08:00
Richard Uhler
56178b8fcb Merge "Use NativeAllocationRegistry for Paint, Canvas, and Bitmap" 2016-01-15 18:23:29 +00:00
Winson
dfb8cb4580 Resetting the native shader instance when the shader changes.
Change-Id: Ib4f8f02d2b777049072e33eabf07d00945c08779
2016-01-14 15:43:38 -08:00
Alan Viverette
253331c051 Clarify interaction between setPivot() and setPivotRelative()
Change-Id: I108df5170f702b4938b4fe7fa35ed42d4a8a2d5d
2016-01-14 13:18:39 -05:00
Richard Uhler
775873a66a Use NativeAllocationRegistry for Paint, Canvas, and Bitmap
Bug: 23130675
Change-Id: I3fbd84ba417ac63df75f87ee2c56e3e7f3c9eb46
2016-01-13 16:14:33 -08:00
Alan Viverette
0ef12aefe5 Clean up LayerDrawable, refactoring only
Uses consistent naming and ordering for padding and inset calculations.
Updates documentation to include UNDEFINED_INSET as public API, since we
return the value and will accept the value as a valid param. Flattens
out RTL logic for readability.

Change-Id: Ie704e2e5fc7f5763500ebe1217ddbbf4d0c5ef86
2016-01-12 09:47:09 -05:00
Matt Sarett
c03c596a53 Merge "Deprecate mCancel in BitmapFactory.Options API" 2016-01-08 15:47:32 +00:00
Matt Sarett
51b75386a8 Deprecate mCancel in BitmapFactory.Options API
This is a follow-up to:
https://googleplex-android-review.git.corp.google.com/#/c/837260/

BUG:26266063
Change-Id: I4a5a9c7bd1f04f27f096ce74668d1509791e1952
2016-01-07 17:56:24 -05:00
Alan Viverette
0671f05fa9 Revert ripple background fast-enter behavior to M style
No longer fast-enters the background for unbounded ripples.

Bug: 25602850
Change-Id: I3250505c1de04a72fb764174abf269e247e21578
2016-01-07 16:37:39 -05:00
Chris Craik
7ee860c416 Merge "Add missing @deprecated comments to canvas methods" 2016-01-06 18:32:50 +00:00
Doris Liu
8190e5dca4 Merge "Avoid calling invalidateSelf() from draw call" 2016-01-05 00:54:36 +00:00