2700 Commits

Author SHA1 Message Date
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
Neil Fuller
568f4de11a Merge "Fix @code escapes" 2015-12-03 09:44:01 +00:00
Neil Fuller
71fbb81b14 Fix @code escapes
The body of {@code} must not be HTML escaped. This is one of
several changes that fix the source in conjunction with a
doclava fix.

Bug: 25757239
Change-Id: Ib38a0fa2dd2a3d68e467f78a812071e763d7e881
2015-12-02 14:24:11 +00:00
Sungsoo Lim
0d3d1f825f Fixed typos: when when
Change-Id: I80c0b8817dcbed45071e42d9ffa88bae52a93a81
2015-12-02 14:50:36 +09:00
John Reck
c34f1b093f Fix RippleDrawable exit animation
Bug: 25602850

The exit-out animation doesn't want to animate from the current
value, but rather the final value of the exit-in animation

Change-Id: I1cd12b0653b5241c6e21ef1cca86b0a83ce9c5a2
2015-11-30 14:47:59 -08:00
Alan Viverette
61ffc199f2 Merge "Apply VectorDrawable density scaling before applying theme" 2015-11-19 14:50:40 +00:00
Alan Viverette
d633ca417d Apply VectorDrawable density scaling before applying theme
Refactors density handling to look more similar to GradientDrawable's
implementation, which should make things easier to maintain. We no
longer update density directly in updateStateFromTypedArray, instead
handling it in applyTheme() and inflate().

Lazily calculates local density-dependent dimensions and invalidates
when the constant state density changes, which should ensure a random
call to applyTheme() will still result in the correct intrinsic
dimensions.

Change-Id: I726878a6cd75d38a550637e3e7a7b6bc68bcaf6d
2015-11-19 09:47:09 -05:00
Doris Liu
804618d086 VectorDrawable native rendering - Step 2 of MANY
Introduced PathData in Java, which is effectively a thin layer around the
native instance. PathData holds the verbs and points which is being used
in path morphing/interpolation. The verbs and points can be interpreted
into skia path commands, which is now done in native and therefore saves
a handful of JNI calls during path creation.

Removed the old PathDataNode mechanism and changed the PathEvaluator
to use PathData instead.

Also added tests and a microbench. Also ran CTS tests for VectorDrawable
and AnimatedVectorDrawable, and passed all of the existing tests.

Change-Id: Ia166f5172ff031fe18b154327967f911a62caec1
2015-11-18 13:38:23 -08:00
Alan Viverette
477f3d092d Obtain cached drawables using the correct Resources object
Previously we were discarding the Resources when forwarding from the
two-arg factory method to the one-arg method. This CL also updates the
documentation for ConstantState to be slightly more comprehensive.

Bug: 25688078
Change-Id: I4fbbf43f95fe792fa6f0bf9db8fd9a7cbfa51d1d
2015-11-16 10:12:44 -05:00
Alan Viverette
b6181565e5 Merge "Return correct intrinsic dimensions for inset colors" 2015-11-13 15:48:23 +00:00
Alan Viverette
76165b2a4b Return correct intrinsic dimensions for inset colors
Also updates documentation for getIntrinsicWidth/Height to accurately
reflect the behavior of the existing implementations and provide an
explanation of what "intrinsic" means.

Bug: 25646242
Change-Id: I11daf57e598148adfda922cfc1ba31ed48a16bd7
2015-11-12 10:47:53 -05:00
Alan Viverette
bd5294bcb8 Pass densityDpi into RippleComponent, store as densityScale
Fixes a regression where the foreground was created against the density
in DPI rather than as a scale factor.

Bug: 25602850
Change-Id: Ia871aa5def4319682a73228efb599f31b65afdb6
2015-11-11 12:51:10 -05:00
Alan Viverette
9db60f4e5b Merge "Mutate DrawableContainer children immediately after inflation" 2015-11-06 21:17:36 +00:00
Alan Viverette
9b4bdeff6d Mutate DrawableContainer children immediately after inflation
Previously we would only mutate children when they were displayed, so
applyTheme() calls would be applied to the shared constant state. Now
we mutate() immediately after obtaining the child, which ensures we
have a clean constant state. This also allows us to remove extra
mutate() calls, since we know all child drawables are already mutated.

Bug: 25081461
Change-Id: I52390db268690a8e181f5b9bbe612b7ed6ce9359
2015-11-06 15:22:43 -05:00
Alan Viverette
22e27ccf79 Merge "Correctly handle child drawables with no intrinsic size" 2015-11-06 19:41:59 +00:00
Alan Viverette
1259f616c2 Use ConstantState directly instead of ConstantStateFuture
All of the functionality of ConstantStateFuture has been moved into
prepareDrawable. We don't need the extra wrapper class.

Change-Id: I452b13320a838a23c8ec0dd486a89bf383142d7b
2015-11-05 14:34:44 -05:00
Riley Andrews
29869c3893 Merge "Convert ashmem bitmap thresholds to constants." into mnc-dr-dev am: c8bb39d98d am: 2c740f1dcf am: 6c1144dc0f
am: 132bb1e4b1

* commit '132bb1e4b10755d2bc0810135511fd999badbe4b':
  Convert ashmem bitmap thresholds to constants.
2015-11-04 20:43:38 +00:00
Riley Andrews
132bb1e4b1 Merge "Convert ashmem bitmap thresholds to constants." into mnc-dr-dev am: c8bb39d98d am: 2c740f1dcf
am: 6c1144dc0f

* commit '6c1144dc0f8b2452ca2a204ca471e2d23339d5a3':
  Convert ashmem bitmap thresholds to constants.
2015-11-04 20:37:18 +00:00
Alan Viverette
ab099c496b Correctly handle child drawables with no intrinsic size
If a child drawable has no intrinsic width or height, don't attempt to
apply padding and insets to the child during the parent layer drawable's
intrinsic width and height calculations.

Bug: 25461370
Change-Id: Idf616bde0449231f38156da53feb858e1ae41c47
2015-11-04 09:54:50 -05:00
Riley Andrews
0394a0c399 Convert ashmem bitmap thresholds to constants.
Bug 25256717

Change-Id: I23e2795ef8798d83bf60dcbd6ff2e7093fcaa9b0
Signed-off-by: Riley Andrews <riandrews@google.com>
2015-11-03 23:52:17 -08:00
Ian Pedowitz
18896e0893 Merge "Limit persistent ashmem backed fds to a minimum of 128kB." into mnc-dr-dev am: 966d6040c6 am: 95fc53b029 am: d6f3e38738
am: 87455c7397

* commit '87455c7397605fba4bf3ad04af8df3c599a7a6ba':
  Limit persistent ashmem backed fds to a minimum of 128kB.
2015-11-03 23:34:54 +00:00
Ian Pedowitz
87455c7397 Merge "Limit persistent ashmem backed fds to a minimum of 128kB." into mnc-dr-dev am: 966d6040c6 am: 95fc53b029
am: d6f3e38738

* commit 'd6f3e38738c88821b28b2571d034fc1b189a35de':
  Limit persistent ashmem backed fds to a minimum of 128kB.
2015-11-03 22:21:48 +00:00
Alan Viverette
4d47d2595e If LayerDrawable child doesn't have constant state, use shallow copy
Avoid NPE if mutate() is called on a LayerDrawable with a child that
doesn't support constant state.

Bug: 25438651
Change-Id: I6bf5a90484fda44a7b5fd10ce7b798eaa799b68e
2015-11-03 15:39:15 -05:00
Riley Andrews
8cee7c1711 Limit persistent ashmem backed fds to a minimum of 128kB.
Bug 25256717

Change-Id: Ieb356006df0a6545b89de44d3d8fd4b46312b3b8
Signed-off-by: Riley Andrews <riandrews@google.com>
2015-11-03 17:46:15 +00:00
Alan Viverette
36555baa55 Merge "Support for changing density of GradientDrawable" 2015-11-02 18:36:09 +00:00
Alan Viverette
ce52037e0a Support for changing density of GradientDrawable
Refactors density resolution and offset/size scaling into static
helper methods.

Also fixes VectorDrawbale insets to be treated as offset-type pixels
rather than size-type.

Bug: 25081461
Change-Id: I10fcb9ebb6c67f853a27ca0ee008c31af4b85da0
2015-10-30 11:07:35 -04:00
Alan Viverette
7e3ede2889 Support for changing density of DrawableWrapper subclasses
Includes a refactoring of DrawableWrapper classes so that the wrapper
super class handles both drawable management and inflation. This allows
us to immediately call through to super() in inflate and applyTheme,
which simplifies density management.

Bug: 25081461
Change-Id: I8c157d340fd1f28a3a2b786c56850a67cdd452e4
2015-10-28 16:57:57 -04:00
Alan Viverette
0cacad7023 Apply density scaling in LayerDrawable and subclasses
Bug: 25081461
Change-Id: I48e62caf5017ff2dd84cf62b68a828f4542b6ae5
2015-10-28 16:37:25 -04:00
Filip Gruszczynski
b6e6662462 Improve infrastructure for replacing windows.
We need to be more precise when removing the window that is being
replaced. We used to depend on the fact that we can remove it after
the first draw of the new added window. However, due to resizing the
old window might reset its draw state and that will trigger a removal
of that window.

We need to add an information about the window that is replacing the
old one and only when this new window draws itself, we remove the old
one.

This improves the transition after maximizing docked window. This is
a situation where first resize operation finishes and immediately
after we have a replacement operation.

Bug: 24914011
Change-Id: Ia8e5bb7872787e663ba23f26588f9c4db1a5e574
2015-10-26 14:11:32 -07:00
Roozbeh Pournader
e1e654d09e Merge "Pass the whole locale list down to Minikin." 2015-10-23 01:39:28 +00:00
Roozbeh Pournader
f036ead2a2 Pass the whole locale list down to Minikin.
Also, compute LocaleList's string representation at construction.
This is to further push the cost of doing costly operations related
to LocaleLists to construction time.

Change-Id: Ia55b8ce66b1088ff54cb42eb1e11149b5bd10f17
2015-10-22 13:14:13 -07:00
Alan Viverette
8cab9b5f1d Merge "Reset constant width/height when DrawableContainer density changes" 2015-10-22 15:02:32 +00:00
Alan Viverette
f1f5f6fcaa Reset constant width/height when DrawableContainer density changes
Bug: 25081461
Change-Id: I9661e964e1d0bacd337e31073faf870d37939b51
2015-10-21 17:14:27 -04:00
Alan Viverette
4a94faa0c7 Scale density correctly on VectorDrawable.applyTheme()
Bug: 25081461
Change-Id: I012e0932e67bc51502dc00e11131218af1377115
2015-10-21 15:15:23 -04:00
Alan Viverette
a3ee41b633 Apply density scaling when updating from typed array
Ensures that density scaling is applied to default dimension values
where needed. Previously, scaling was only applied when a drawable
was loaded from cached constant state; however, drawables that were
preloaded against a different density and first loaded in some other
density were not scaled.

Bug: 25081461
Change-Id: I0f8058cc01e2fe8d6bd7e255eba40485f3cbe48b
2015-10-20 17:15:27 -04:00
Alan Viverette
02f633d4cf Clean up VectorDrawable usage of stroke and fill color state lists
Only store stateful CSLs; otherwise, just use the default (e.g. the
only available) color.

Bug: 25074102
Change-Id: I050c89841d4c6bf22473a66c713a845b0358dc94
2015-10-19 15:18:53 -04:00
Filip Gruszczynski
2a6a2c2de8 Change WindowState.mShownFrame to WindowState.mShownPosition.
We never use this field as a rectangle, we only depend on its left-top
corner. Using a frame is only confusing about the purpose of this field.

Change-Id: I5d6e6321db4fa3203bb7e0f1975ae6ddd1ec09bb
2015-10-14 12:17:11 -07:00
John Reck
dbffd25000 Fix Paint's JNI
Bug: 22409077
Change-Id: I99e1a11bf14f5b62c41107528f573eaf9f2d4b2f
2015-10-02 09:27:10 -07:00
Keisuke Kuroyanagi
3089211ce6 Merge "Add tests: Paint#measureText for bidirectional text." 2015-10-01 20:11:49 +00:00
Keisuke Kuroyanagi
2c53a07597 Merge "Consolidate native methods for text measurement." 2015-09-29 21:31:56 +00:00
Keisuke Kuroyanagi
536afe6ef7 Consolidate native methods for text measurement.
Bug: 24505153

Change-Id: I6a00b0516442f7d6108ed0598516365310bd85e8
2015-09-29 13:52:45 -07:00