2740 Commits

Author SHA1 Message Date
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
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
Doris Liu
841f6e19ba Avoid calling invalidateSelf() from draw call
Bug: 26329675

Change-Id: Ieb76b6f63a5139f6033ca9baa9ba6fac36ae466c
2016-01-05 00:53:07 +00:00
Matt Sarett
e3b8f255cf Merge "Make BitmapFactory.Options API Changes" 2016-01-04 22:55:38 +00:00
Matt Sarett
5e2496bcee Make BitmapFactory.Options API Changes
This changes the documentation for inPreferQualityOverSpeed,
inDither, and requestCancelDecode().

These changes are a result of modifying the backends of
BitmapFactory and BitmapRegionDecoder to be faster, higher quality,
and to use standard libraries.

BUG:26266063
BUG:25556965
Change-Id: I9008fd276a38c737e242bcc6930ffe4e36d9fd1d
2016-01-04 17:20:17 -05:00
Doris Liu
4bbc293126 VectorDrawable native rendering - Step 3 of MANY
- Refactored VPathRenderer & VectorDrawableState
- Moved all the VD rendering into native
- Set up hooks for VD's property changes in JNI for animated VD

TODO: JNI calls can be further reduced when we convert the animation
in AVD to use RenderNodeAnimator, in which case animation will be
driven from native and therefore most of the JNI hooks for changing
VD's properties during animation will no longer be needed.

Change-Id: I52021f4d7bea057b83ace54085d870dd45acae0f
2015-12-28 16:08:38 -08:00
Philip P. Moltmann
bb9f686b40 Allow a print service to specify per printer icons, description and
info-activities

The icon is loaded from the discovery session only when it is displayed
to avoid having to store too many icons in memory.

Also the icons are not maintained in the historical printers. Only if
the printers are available nice icons are shown. A historical printer is
updated with the appropriate properties (including icon) once it becomes
available.

Bug: 24135005
Change-Id: Iec389bab514b024634be8fb5fc8928371cba8740
2015-12-21 09:54:57 -08:00
Chris Craik
eda57925ca Add missing @deprecated comments to canvas methods
bug:25311154

Change-Id: Ie89e2160969eb7b4187f28ab4b0342804cf67724
2015-12-17 15:42:51 -08:00
Chris Craik
92c11864c7 Correct drawLines annotations
Change-Id: I161e419a3ce427e10d802ba692679ad671e23dde
2015-12-17 15:11:24 -08:00
Ben Wagner
8349b7a063 Use 'index' instead of 'ttcIndex' for attribute name.
There are two reasons for this. First, the name 'ttcIndex' is over
specific, there are many indexed font containers in addition to ttc,
such as fon, pfr, bdf, and dfont. There may be others in the future.
Second, Skia implemented this attribute with the name 'index' quite
some time ago. By naming this attribute 'index' even existing apps will
be able to use this attribute (including Chrome).

BUG: 10861108
Change-Id: I68d2b69fad304d93313f96bf3365af71906dfe69
2015-12-12 05:57:14 +00:00
Seigo Nonaka
ac3f10f153 Fix invalid API use of XmlPullParser.getAttributeValue.
The 1st argument of the getAttributeValue is a namespace of the xml.

Bug: 10861108
Change-Id: I73fd15eca7101b745870ca7b6509b1dbfcc9b0d7
2015-12-10 18:23:37 -08:00
Seigo Nonaka
3fa667e224 Introduce ttcIndex attribute into system font configuration.
ttcIndex is used for specifying index of the TrueType Collection.
No user visible change is expected with this CL.

BUG: 10861108
Change-Id: I76a1c890164bb55a7ece7b9c7db2ce2bac3f8b89
2015-12-10 16:50:44 -08:00
Yin-Chia Yeh
44581ff4db Camera: add RAW_PRIVATE format
Also add necessary plumbing for RAW_PRIVATE to work for ImageReader.

Bug: 25596619
Change-Id: Ic90f3f44264ac46fae1fafbc27ac64b5319f0970
2015-12-09 11:20:32 -08:00
Seigo Nonaka
3899902fe7 Merge "Introduce cache mechanism for LocaleList." 2015-12-09 03:28:21 +00:00
Selim Cinek
ea4bef7386 Removed duplicate content from group notification header
Previously the headers all had duplicate content, which is
now optimized to look visually more appealing.

Change-Id: I38ed8db1985fd8a9470888e1b7e1e6b0f2e23b19
2015-12-08 16:25:00 -08:00
Alan Viverette
d35c13df6e Merge "Attach drawable resource ID and name to getDrawable() exceptions" 2015-12-08 19:49:56 +00:00
Alan Viverette
c078c605ab Attach drawable resource ID and name to getDrawable() exceptions
Wraps the entire getDrawable() method in a try/catch block. Clears the
stack trace from the re-thrown exception, since we only need the trace
from the original exception.

Also clears stack traces from re-thrown RuntimeExceptions in applyTheme
implementations.

Change-Id: I92396abf9e748eef78777174b297a09e118f5e70
2015-12-08 14:49:13 -05:00
Seigo Nonaka
cfc607cf57 Introduce cache mechanism for LocaleList.
Setting the LocaleList to the native Paint object is not a lightweight
operation since it needs to propagate a string object to the native code
which then needs to parse it for making minikin language list.

To avoid performance regressions, cache the minikin language ID in
android.graphics.Paint and send the LocaleList with cached ID
instead of a string the next time native code is called.

BUG: 25122318
Change-Id: Ib5ce8bcff8a1c0a2b1a1c3d1868ea8be5a0e642f
2015-12-07 16:50:20 -08:00
Chris Craik
f3dc7ac724 Correct GradientDrawable outline alpha computation
bug:26066107

GradientDrawable should provide a shadow casting outline if using a
translucent fill.

Change-Id: Ie6b409bafe3fcf9c5216662168d7349e2a9e3413
2015-12-07 13:48:40 -08:00