2302 Commits

Author SHA1 Message Date
Alan Viverette
7f4a63d1eb Ensure we don't pass null values in to Theme.resolveAttributes
BUG: 18182274
Change-Id: I08acf877cb81478cc205254edf92a31fcf05991d
2014-10-30 10:29:03 -07:00
Alan Viverette
425b1dc88c Merge "Add theme and config change support to more Drawable types" into lmp-mr1-dev 2014-10-30 00:24:28 +00:00
Alan Viverette
d21fd9d1cc Add theme and config change support to more Drawable types
BUG: 16045735
Change-Id: Ic03173a1c1779c1bb545c4c389f77afed97011ee
2014-10-29 10:24:42 -07:00
Alan Viverette
51547e750e am eba0a750: Merge "Clean up GradientDrawable styled attributes, fix useLevelForShape" into lmp-mr1-dev automerge: 91a1a72
* commit 'eba0a7509178094a46c3cca212bc3f07e70b159e':
  Clean up GradientDrawable styled attributes, fix useLevelForShape
2014-10-24 23:03:11 +00:00
Alan Viverette
969ca91acd Clean up GradientDrawable styled attributes, fix useLevelForShape
BUG: 18117976
Change-Id: Iff2ea392204346f68ea47d577e442d398114e5d8
2014-10-24 12:25:04 -07:00
Yigit Boyar
ab43570f5d am f3ab4410: am fa9ed8ca: Merge "Added a generic configuration and theme based cache" into lmp-mr1-dev
* commit 'f3ab441090a05bd428b9488b2e8e175f33bd6fe9':
  Added a generic configuration and theme based cache
2014-10-23 22:04:11 +00:00
Yigit Boyar
d422dc358f Added a generic configuration and theme based cache
For now, only animators use it but we can consider migrating
drawable cache to it as well.

Bug: 17456416
Change-Id: I571b96856805edb171f0fc52e6bff5a365f46b70
2014-10-23 11:46:01 -07:00
Alan Viverette
ef2fef1719 am ed89e452: am 7c133e19: Merge "Fix gradient drawable radius when specified as float, dimension" into lmp-mr1-dev
* commit 'ed89e45253ffded993ed88cd33457f45dbd6a32b':
  Fix gradient drawable radius when specified as float, dimension
2014-10-21 18:39:06 +00:00
Alan Viverette
2c861c782d am 0a8a3eab: am 46b4920a: Merge "Propagate state changes even when we don\'t change drawable index" into lmp-mr1-dev
* commit '0a8a3eab8bfc3390e1225dfade40599279b4921b':
  Propagate state changes even when we don't change drawable index
2014-10-21 18:29:02 +00:00
Alan Viverette
7c133e19dd Merge "Fix gradient drawable radius when specified as float, dimension" into lmp-mr1-dev 2014-10-21 18:25:01 +00:00
Alan Viverette
46b4920ac8 Merge "Propagate state changes even when we don't change drawable index" into lmp-mr1-dev 2014-10-21 18:14:50 +00:00
Alan Viverette
2efbe9816e Fix gradient drawable radius when specified as float, dimension
BUG: 18070756
Change-Id: I991ff792c376c9695a007f8f1187390ab5ff6e3c
2014-10-21 11:04:04 -07:00
Alan Viverette
f81c6af10e Propagate state changes even when we don't change drawable index
Previously we could miss the state change if we were simply reversing the
current transition.

BUG: 17967405
Change-Id: I2cb396dedbff61b980741ef8c0d931be6abe129c
2014-10-20 14:42:53 -07:00
ztenghui
9aa6ea106d am 8c857eec: am 12d808a2: am a724d1ab: am 877ce2c4: Merge "Make sure the bitmap from VD\'s cache is drawn using bi-linear filter." into lmp-dev
* commit '8c857eec746307dfeb8acb6b080ecc2aa8476ece':
  Make sure the bitmap from VD's cache is drawn using bi-linear filter.
2014-10-20 20:56:09 +00:00
ztenghui
12d808a24f am a724d1ab: am 877ce2c4: Merge "Make sure the bitmap from VD\'s cache is drawn using bi-linear filter." into lmp-dev
* commit 'a724d1ab4083f08958bd88e76e15b7c0af337bfc':
  Make sure the bitmap from VD's cache is drawn using bi-linear filter.
2014-10-20 20:42:51 +00:00
ztenghui
b12ff84159 am 877ce2c4: Merge "Make sure the bitmap from VD\'s cache is drawn using bi-linear filter." into lmp-dev
* commit '877ce2c42b5d423719246f5458cd66fa9fddb317':
  Make sure the bitmap from VD's cache is drawn using bi-linear filter.
2014-10-20 20:36:34 +00:00
ztenghui
eec6164e6f Make sure the bitmap from VD's cache is drawn using bi-linear filter.
b/17949291

Change-Id: I0e59852220ab8a3be2c70afa483e805029a9e19e
2014-10-16 15:40:04 -07:00
Alan Viverette
fac81d40e1 am 274d24f1: am b70cfb91: Merge "Avoid saveLayer in RippleDrawable if the background won\'t draw" into lmp-mr1-dev
* commit '274d24f18d30eb18eaa4d9ece3056a3b9856721d':
  Avoid saveLayer in RippleDrawable if the background won't draw
2014-10-15 21:25:38 +00:00
Alan Viverette
b70cfb9103 Merge "Avoid saveLayer in RippleDrawable if the background won't draw" into lmp-mr1-dev 2014-10-15 21:18:00 +00:00
Alan Viverette
6ee5699b22 am eecfb52a: am 9a00cbcc: Merge "Update preload list, clean up drawable theming" into lmp-mr1-dev
* commit 'eecfb52ad56a3bb4f5bf2cdaeb83cfe8b33fa0c1':
  Update preload list, clean up drawable theming
2014-10-15 02:07:34 +00:00
Alan Viverette
9a00cbcc66 Merge "Update preload list, clean up drawable theming" into lmp-mr1-dev 2014-10-14 22:47:43 +00:00
Alan Viverette
17cd4dfe3a Update preload list, clean up drawable theming
Removes all implementations of three-arg ConstantState constructor, since
we handle mutation and applyTheme() in Resources now. Moves progress bar
tinting to android:tint attribute. Correctly implements applyTheme() and
canApplyTheme() in all drawable wrapper and container classes.

Change-Id: Ic9cb43d0d6228aa4914f3124bed234b837beaa41
2014-10-14 14:07:21 -07:00
Alan Viverette
882d5cd051 am d9a2b99d: am 42e96769: Merge "Add support for tint and tintMode to GradientDrawable" into lmp-mr1-dev
* commit 'd9a2b99de201c89b1b6c58eae213bb15bef58168':
  Add support for tint and tintMode to GradientDrawable
2014-10-14 17:50:34 +00:00
Alan Viverette
b50d158605 am db8ecf80: am 788e30bd: Merge "Revert "Always project ripples"" into lmp-mr1-dev
* commit 'db8ecf8005294833a9fe758e5e4a4d6fd100bd66':
  Revert "Always project ripples"
2014-10-14 17:50:27 +00:00
Alan Viverette
42e96769ae Merge "Add support for tint and tintMode to GradientDrawable" into lmp-mr1-dev 2014-10-14 01:00:36 +00:00
Alan Viverette
788e30bd34 Merge "Revert "Always project ripples"" into lmp-mr1-dev 2014-10-14 00:37:03 +00:00
Alan Viverette
43027b7bca Add support for tint and tintMode to GradientDrawable
BUG: 17975498
Change-Id: I8aeec48b8499abaf055e75018759f99801efdecc
2014-10-13 16:55:59 -07:00
Alan Viverette
a7b64e8eef Avoid saveLayer in RippleDrawable if the background won't draw
BUG: 17952941
Change-Id: Ic2640f847e2ed43fc5117d43230513ee7696d9e7
2014-10-13 16:47:57 -07:00
Alan Viverette
2627206e1b Revert "Always project ripples"
Projecting ripples places them under shadows, which is not
ideal. Punting this workaround and waiting until we have
proper support for rounded corner clipping on windows.

This reverts commit f90b6bd54f60960a790b5bd507a0d75d961a981a.

Change-Id: I61946649bbb1bf74a969d74e5353608afc8e4463
2014-10-13 23:18:04 +00:00
Alan Viverette
2776b17327 am 204e9f4c: am 2f82e48a: Merge "Always project ripples" into lmp-mr1-dev
* commit '204e9f4cae2d49348c121c9738f8f33b5cb20b27':
  Always project ripples
2014-10-13 21:07:55 +00:00
Alan Viverette
2f82e48abb Merge "Always project ripples" into lmp-mr1-dev 2014-10-13 20:58:48 +00:00
Alan Viverette
bb3fad78c9 am 8cb9a9e6: am 284559bf: Merge "Fix inset drawable\'s intrinsic size, replace ic_text_dot asset" into lmp-mr1-dev
* commit '8cb9a9e6ba602cc4a2da334fcec966e7f06c63a4':
  Fix inset drawable's intrinsic size, replace ic_text_dot asset
2014-10-11 00:22:41 +00:00
Alan Viverette
cdd5e067f2 Fix inset drawable's intrinsic size, replace ic_text_dot asset
BUG: 17648301
Change-Id: I8af0f6d1beee7a1cb3a3b9db571ed2c407e24556
2014-10-10 14:08:32 -07:00
Dianne Hackborn
75a6e82bcc am 36ae48a8: am d83e9e42: am 0761b1b5: am 89b19695: Merge "Put in real "code" (aka marketing) name." into lmp-dev
* commit '36ae48a850bade17d485cb49dd40a3f11f667ad4':
  Put in real "code" (aka marketing) name.
2014-10-10 04:26:40 +00:00
Alan Viverette
3ad81eee72 am 2eda6f07: am 466f5581: Merge "Slow down ripple background fade in from press" into lmp-mr1-dev
* commit '2eda6f078cd6014a860903f515affa4d6a58748a':
  Slow down ripple background fade in from press
2014-10-09 22:23:16 +00:00
Alan Viverette
f90b6bd54f Always project ripples
We already handle bounding rect in draw(), so this just ensures
that ripples are always clipped to window background outlines
until we can implement more general clipping.

BUG: 17498583
Change-Id: Iaff51fb177b017a11822bdf4f31c117fc9522c15
2014-10-09 14:47:19 -07:00
Dianne Hackborn
d83e9e4280 am 0761b1b5: am 89b19695: Merge "Put in real "code" (aka marketing) name." into lmp-dev
* commit '0761b1b5ebb453a411e3289c1c972dbfddcee880':
  Put in real "code" (aka marketing) name.
2014-10-09 13:03:21 +00:00
Dianne Hackborn
529b78941c am 89b19695: Merge "Put in real "code" (aka marketing) name." into lmp-dev
* commit '89b196958fee07475765bd3c458098464ba16f2e':
  Put in real "code" (aka marketing) name.
2014-10-08 22:48:44 +00:00
Alan Viverette
f92f26fef2 Slow down ripple background fade in from press
BUG: 17433613
Change-Id: Ie9c4046532d61ad8ef8e044d14557db5d52e0d0b
2014-10-08 14:49:21 -07:00
Dianne Hackborn
955d8d69ea Put in real "code" (aka marketing) name.
Change-Id: Idb3976edfae37293ed75cb5b869b4b42d8042bbe
2014-10-07 20:17:19 -07:00
Alan Viverette
859edf7963 am 0b6b0fa1: am 0660042a: Merge "Mutate and apply theme if needed before caching themed drawables" into lmp-mr1-dev
* commit '0b6b0fa154b2c02b6ccd90fa083acf422adfcc8c':
  Mutate and apply theme if needed before caching themed drawables
2014-10-07 22:17:21 +00:00
Alan Viverette
727cae197b Mutate and apply theme if needed before caching themed drawables
This ensures that drawables are completely separated from their cached
constant states before applying a theme. After this, we can remove the
implicit (and incomplete) mutation in the clone constructors.

Also implements missing mutate() method on ClipDrawable.

BUG: 17646144
Change-Id: If0d66b0a85724d76e0a4f506758c7ba3c0aa3410
2014-10-07 15:08:47 -07:00
Alan Viverette
b4e8077b52 am 9f64867d: Merge "Fix theme propagation to contained android:drawable elements" into lmp-dev
* commit '9f64867da107b772b867876ddf979d1a3ec19192':
  Fix theme propagation to contained android:drawable elements
2014-10-02 23:41:44 +00:00
Alan Viverette
e32715d696 am c03d6f89: am 855e63e9: am 29345d8d: am 9f64867d: Merge "Fix theme propagation to contained android:drawable elements" into lmp-dev
* commit 'c03d6f89d0182d317bef0b810d5c4e62f8c7bad2':
  Fix theme propagation to contained android:drawable elements
2014-10-02 23:38:12 +00:00
Alan Viverette
39e33621a7 Fix theme propagation to contained android:drawable elements
BUG: 17790666
Change-Id: I6733a98e779cad0d384b917c57d2b3409a166c02
2014-10-02 15:54:23 -07:00
Neil Fuller
c2a0b4482d resolved conflicts for merge of ee665151 to lmp-mr1-dev-plus-aosp
Change-Id: I2588c65b7a9fa43f968151a206924a804f0595a7
2014-10-02 14:32:37 +01:00
Neil Fuller
f7cf5d43aa resolved conflicts for merge of ee665151 to lmp-dev-plus-aosp
Change-Id: I97671e62de26919e391dbb2686511584c59ab990
2014-10-02 11:48:08 +01:00
ztenghui
fee7f1b1d9 am ec81db6a: am c4306923: am 9e6a02b9: am ffa16f94: Merge "Correct the documentation for VectorDrawable" into lmp-dev
* commit 'ec81db6ab43de69a9bba333c1939e6213af085fa':
  Correct the documentation for VectorDrawable
2014-10-01 17:10:16 +00:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Alan Viverette
32eb1a52b3 am 6a26bf14: am eca52d91: am 35ebdd05: am b805da9b: Merge "Fix drawable container tinting" into lmp-dev
* commit '6a26bf14a9eed00ca4835c0b2cd3b1d89686db89':
  Fix drawable container tinting
2014-10-01 01:42:46 +00:00