Commit Graph

2784 Commits

Author SHA1 Message Date
John Reck
88b4e87ae6 Merge \\"Clarify Picture docs on playback\\" into nyc-mr1-dev am: 226b4764b4
am: 917d0abd30

Change-Id: I6efc71dbe4d152e0265faf5056f8e385738a2442
2016-07-01 21:17:05 +00:00
John Reck
226b4764b4 Merge "Clarify Picture docs on playback" into nyc-mr1-dev 2016-07-01 20:41:24 +00:00
Tenghui Zhu
7839e42315 Merge \\"Mutate the drawable if a valid state change happen\\" into nyc-mr1-dev am: 919e982c3f
am: 96c4176210

Change-Id: I38f38fd3b1c349dd938f41b199f572628c9987d7
2016-06-30 23:01:15 +00:00
Teng-Hui Zhu
4f1acfb5f5 Mutate the drawable if a valid state change happen
In another word, create another cached bitmap, when the current VectorDrawable
will look differently when state changed.

b/29870392

Change-Id: I7a5ef91091e547a930368286defc7ab96aeb9471
2016-06-30 16:30:02 +00:00
John Reck
943c4e0813 Clarify Picture docs on playback
Change-Id: Iaf8d8d04deb97aff39c93c246ef20312c9c2a7cb
fixes: 26911597
2016-06-29 16:09:20 -07:00
Alan Viverette
61d7a8aad3 Merge \\\"Disable constant state sharing for VectorDrawable\\\" into nyc-dev am: f66bdf9b57 am: 25242a7bbc
am: edb98d238f

Change-Id: Iad1b27849bfa501064cb3452caed3571fcdf8430
2016-06-29 17:10:50 +00:00
Alan Viverette
25242a7bbc Merge \"Disable constant state sharing for VectorDrawable\" into nyc-dev
am: f66bdf9b57

Change-Id: I0c6397987d926c35cb5486fd9d2cb22efb8d8f14
2016-06-29 17:01:21 +00:00
Alan Viverette
f66bdf9b57 Merge "Disable constant state sharing for VectorDrawable" into nyc-dev 2016-06-29 16:54:29 +00:00
Alan Viverette
1882ce941b Disable constant state sharing for VectorDrawable
Bug: 29854240
Change-Id: Icc58d04ad6f471d05b085a9089893e4f7205eb7d
2016-06-29 11:32:13 -04:00
Chris Craik
17b49651af Merge \\"Clip GradientDrawable\\'s saveLayer\\" into nyc-mr1-dev am: 694acb1e36
am: b22e745278

Change-Id: I331574caa364e87c5178bee544e1b6d570fb4ea5
2016-06-28 18:37:42 +00:00
Chris Craik
1e5d428b3f Clip GradientDrawable's saveLayer
bug:29456451

Avoid using very expensive unclipped saveLayer codepath.

Change-Id: Ib96a46169faa89eda6889b16813a7941ab402779
2016-06-28 09:45:35 -07:00
Alan Viverette
aa2b45da4d Merge \\\"Only block invalidation in DrawableContainer initialization\\\" into nyc-dev am: 7a372a13af am: 9b81f5bfaf
am: fdc99784c7

Change-Id: I2d71a46405e1ff208f6b4fdcc71b82bb8073a385
2016-06-21 14:04:55 +00:00
Alan Viverette
fdc99784c7 Merge \\"Only block invalidation in DrawableContainer initialization\\" into nyc-dev am: 7a372a13af
am: 9b81f5bfaf

Change-Id: I23aa33f0a65e311fcb0db3884216666c1d6bc01c
2016-06-21 13:59:29 +00:00
Alan Viverette
e77dc4fe06 Merge \"Only block invalidation in DrawableContainer initialization\" into nyc-dev
am: 7a372a13af

Change-Id: I21a7dbf975a8dca02d87b9a0f084a6af74d55834
2016-06-21 13:53:49 +00:00
sergeyv
a8d3485f3d Fix documentation for GradientDrawable.getCornerRadius
Change-Id: I4ad1ef7d989df250a9208107b5baac9e79816194
2016-06-20 18:45:25 -07:00
Doris Liu
633c24947c Merge \\"Support AVD animation falling back on UI thread\\" into nyc-mr1-dev am: 4e5ee65307
am: 2df9343a77

Change-Id: I4ca02328c52c8802dc5c006ab4bec6b1ec04cd87
2016-06-17 21:04:23 +00:00
Alan Viverette
6d823891bb Only block invalidation in DrawableContainer initialization
Blocking (un)scheduling breaks AnimationDrawable's internal consistency.

Bug: 29309316
Change-Id: I59c79a4a9a92b599cd94bd941ae78ac25b874add
2016-06-17 13:08:42 -04:00
Doris Liu
126df850ce Support AVD animation falling back on UI thread
AVD will fall back to UI thread animation if the host view is
rendering onto a SW layer.

BUG: 27617346
Change-Id: I5b644529048a0c30aada3abf2f4e95e40760936d
2016-06-16 22:09:44 +00:00
Philip P. Moltmann
f3f7cccccf Return NPE instead of ISE if page is closed.
To comply with the legacy behavior.

Change-Id: I2b3c4d6d1f41022e72e5c22fe4402864d9e54986
2016-06-10 14:15:42 -07:00
Doris Liu
c9493879d7 Support Keyframe definition for AVD on RT
BUG: 27441613
Change-Id: Iece386f65f3704d1b7caa2b3690a8d3048ccf6e2
2016-06-09 14:40:32 -07:00
Doris Liu
a57e95a6a3 Throw Exception for wrong valueType with API guard
Previously, wrong valueType error is swallowed in jni. As a result,
some animations are quietly skipped without letting developers know.
This CL maintains that behavior for pre-N, and throws Exception
to notify developers of the error for N and above.

Bug: 29009391
Change-Id: I3e8f003cdb97d214da72af3f93a84f64797b1c2c
(cherry picked from commit 94db09917a)
2016-06-09 14:39:18 -07:00
Doris Liu
3f6a95283a Merge "Handle hidden RT VectorDrawable animators" into nyc-mr1-dev 2016-06-09 21:30:03 +00:00
Doris Liu
718cd3eb70 Handle hidden RT VectorDrawable animators
This CL changes the target of VD specific animators to VectorDrawable,
instead of RenderNode. The benefit of doing so is that animators can
now detect whether the animation is meaningful by checking whether
their VD target is in the display list. If not, that means the VD is
not drawing for the current frame, in which case we can be smarter
and more power efficient by removing the animator from the list and
posting a delayed onFinished listener callback.

By setting VD as the animation target, when an ImageView decides to
update its drawable from one AVD to something else, we'll be able
to detect that the previous AVD is no longer in the display list,
and stop providing animation pulse to the stale AVD, which is
something we couldn't do previously.  This change also
handles the case where one AVD instance could be drawn in two
different views.

Bug: 27441375
Change-Id: Iaad1ed09cfd526276b95db0dd695275c28e074e8
2016-06-09 10:27:59 -07:00
Doris Liu
7e1d493267 Merge "Support Keyframe definition for AVD on RT" 2016-06-09 00:05:41 +00:00
Doris Liu
a6b967cfc5 Support Keyframe definition for AVD on RT
BUG: 27441613
Change-Id: Iece386f65f3704d1b7caa2b3690a8d3048ccf6e2
2016-06-08 15:21:15 -07:00
Doris Liu
792926a58c Improve the property modification effiency of VectorDrawable animators
Previously, the VectorDrawable animators modify the VD properties by
doing reflection based on the property name. This CL avoids the overhead
of calling reflection by wrapping the setters of VD objects in
Float/IntProperty.

Bug: 28124049
Change-Id: I562c8d749fdfe508564c82a700a92e835cdd9ff4
(cherry picked from commit 9f3b31b953)
2016-06-08 20:43:34 +00:00
Philip P. Moltmann
f126e21f43 Handle bitmap==null in PdfRenderer.Page#render.
Change-Id: Ie24ca45d4b5e27d5e99de72115e8e00b32b30655
2016-06-08 11:37:24 -07:00
Philip P. Moltmann
c859cd068b Fix up issues in PdfRenderer found by test.
Change-Id: I56e403fd425e4b4353383c43077de5c47ff22b5c
2016-06-07 17:04:25 -07:00
Doris Liu
94db09917a Throw Exception for wrong valueType with API guard
Previously, wrong valueType error is swallowed in jni. As a result,
some animations are quietly skipped without letting developers know.
This CL maintains that behavior for pre-N, and throws Exception
to notify developers of the error for N and above.

Bug: 29009391
Change-Id: I3e8f003cdb97d214da72af3f93a84f64797b1c2c
2016-06-01 14:22:28 -07:00
Doris Liu
0794f537da Merge "Copy native tree's property when mutate vector drawable" 2016-05-28 01:11:23 +00:00
The Android Automerger
6f2f02e4ae Merge commit '93c1d3aa6e20b52a37548af0bf9f9a66948a7611'
* commit '93c1d3aa6e20b52a37548af0bf9f9a66948a7611':
  docs: Refinements for testing
  Fix toast with accessibility and app pinning
  Updated link to material design page.
  Change overdraw test to use windowbackground
  Prevent callbacks during DrawableContainer child initialization
  Fixing crash in SysUI due to invalid group.
  Cherry pick: docs: Edited "Features Reference" section in "<uses-feature>" page.
  Fix Activity Transition mess-up.
  Time to #NameAndroidN!
  Prevent use of a null sCallbackObj by Hardware FLP
  Fixed the relative time spoken with accessibility
  Use backstop timeouts on asynchronous countdown during preflight
2016-05-27 20:05:56 +00:00
Doris Liu
028029730b Copy native tree's property when mutate vector drawable
When mutating vector drawables, we need to not only copy over
the VD tree structure, but also the properties of the VD tree,
such as alpha.

Bug: 28974071
Change-Id: I265e7e3cb92455b876cae248bcb9811230cb34f9
2016-05-27 10:54:55 -07:00
Doris Liu
335d7d1744 Copy native tree's property when mutate vector drawable
When mutating vector drawables, we need to not only copy over
the VD tree structure, but also the properties of the VD tree,
such as alpha.

Bug: 28974071
Change-Id: If793f5f2b6e116472a1c6da0fb60d8278a78b03f
2016-05-26 16:06:58 -07:00
Alan Viverette
2b561f1c35 Prevent callbacks during DrawableContainer child initialization
Bug: 28900939
Change-Id: I9c6c8af1665c2dc0bfa8bc8fc773c81e14f6aab1
2016-05-26 16:49:29 -04:00
Doris Liu
f143417bab Merge "Handle hidden RT VectorDrawable animators" 2016-05-26 20:45:33 +00:00
Doris Liu
67ce99b66e Handle hidden RT VectorDrawable animators
This CL changes the target of VD specific animators to VectorDrawable,
instead of RenderNode. The benefit of doing so is that animators can
now detect whether the animation is meaningful by checking whether
their VD target is in the display list. If not, that means the VD is
not drawing for the current frame, in which case we can be smarter
and more power efficient by removing the animator from the list and
posting a delayed onFinished listener callback.

By setting VD as the animation target, when an ImageView decides to
update its drawable from one AVD to something else, we'll be able
to detect that the previous AVD is no longer in the display list,
and stop providing animation pulse to the stale AVD, which is
something we couldn't do previously.  This change also
handles the case where one AVD instance could be drawn in two
different views.

Bug: 27441375
Change-Id: Id4b3b37f28274c917cb9beb9dcd3d1e6991b5c5d
2016-05-26 11:13:19 -07:00
Alan Viverette
1c1fbf2c44 Merge "Prevent LayerDrawable bounds updates from being re-entrant" into nyc-dev am: 5c9444216d am: 6b525a2645
am: c44c760b9c

* commit 'c44c760b9c711eb22d0a937d56def02e57f5fc37':
  Prevent LayerDrawable bounds updates from being re-entrant

Change-Id: If51c75c3b9d5d39dfa8d0ed6c8113ed68ed430ee
2016-05-25 14:40:15 +00:00
Alan Viverette
09deff1bd9 Prevent LayerDrawable bounds updates from being re-entrant
Collect child invalidations during layer bounds change, then dispatch a
single invalidation if any children requested invalidation. This prevents
re-entrance from, for example, a LayerDrawable.updateLayerBounds() call
invoking setBounds() on a child, which necessarily calls invalidateSelf()
and immediately propagates up to ImageView.invalidateDrawable(), which
then calls configureBounds() and puts us back in updateLayerBounds().

Bug: 28636072
Change-Id: I36c9eefc18904d493292d51b37e4b05cfddcf794
2016-05-24 15:14:38 -04:00
Doris Liu
9f3b31b953 Improve the property modification effiency of VectorDrawable animators
Previously, the VectorDrawable animators modify the VD properties by
doing reflection based on the property name. This CL avoids the overhead
of calling reflection by wrapping the setters of VD objects in
Float/IntProperty.

Bug: 28124049
Change-Id: I562c8d749fdfe508564c82a700a92e835cdd9ff4
2016-05-23 18:33:24 -07:00
Yohei Yukawa
af15c8bcae Merge "Move LocaleList to avoid layering violation." into nyc-dev am: 31884efd13 am: ddaf3f4681
am: bf4c8f730b

* commit 'bf4c8f730b167e5ee65ed7c59dfa1d7867b63fcc':
  Move LocaleList to avoid layering violation.

Change-Id: I78fee5269f7428e34b196573575784fc15cb1372
2016-05-18 02:25:10 +00:00
Yohei Yukawa
23cbe85610 Move LocaleList to avoid layering violation.
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.

Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
2016-05-17 16:42:58 -07:00
Philip P. Moltmann
e66baed387 Merge "Only have a single call into pdfium at a time." 2016-05-17 16:22:55 +00:00
Hans Boehm
0d65743fea Clear more native pointers in finalizers
This hopefully handles the remaining finalizers in frameworks/base
that didn't guard against calls from other finalizers after being
finalized.

The goal here is to reduce the possible corruption causes we have
to think about by a few.

If any of theses are either very frequently used, or use large
Java (as opposed to native) objects, we should probably convert them
to NativeAllocationRegistry instead. But that's more work.

Bug: 18178237
Change-Id: I79bc0e8fa20af8f340418a6226022e0294d77f02
(cherry picked from commit ad3cc3c63c)
2016-05-16 13:45:21 -07:00
John Reck
41f864ec45 Minor optimizations
Don't save matrix if we just need clip saved
Early-reject the easy-to-reject cases in Canvas
before hitting JNI

Change-Id: I385ef90a31efbda31ce37837152f626aad553ee7
2016-05-12 15:07:49 -07:00
Philip P. Moltmann
0768a7dc45 Only have a single call into pdfium at a time.
Pdfium is not thread safe and uses global variables, hence no
parallel call pdfium is safe

Fixes: 28705066
Change-Id: I04309ee691bd9cea37587e0af5be2c07ce8c9f2c
2016-05-12 14:19:28 -07:00
Teng-Hui Zhu
e116fc5cf9 Merge "Update and add attributes to the JavaDoc for VectorDrawable" into nyc-dev
am: caacf332a1

* commit 'caacf332a1e568e065c9245565c135a7450cc941':
  Update and add attributes to the JavaDoc for VectorDrawable

Change-Id: I4d7de86055da3dcd581a7497de7f7d516fbf6ed2
2016-05-12 00:34:16 +00:00
Teng-Hui Zhu
a8d671a144 Update and add attributes to the JavaDoc for VectorDrawable
fix:28678266

Change-Id: Ife23937feb6ccbd043bd435ffcb20a79a8861edf
2016-05-11 14:31:45 -07:00
Hans Boehm
0024c91409 Merge "Clear more native pointers in finalizers" am: a5ca0ca886
am: 8521a8ff86

* commit '8521a8ff860e89ca60d530db60f58878847cf52a':
  Clear more native pointers in finalizers

Change-Id: Icca385cd603ad15ab02f2033f8652e3a8d2f6c3d
2016-05-10 23:48:16 +00:00
Hans Boehm
ad3cc3c63c Clear more native pointers in finalizers
This hopefully handles the remaining finalizers in frameworks/base
that didn't guard against calls from other finalizers after being
finalized.

The goal here is to reduce the possible corruption causes we have
to think about by a few.

If any of theses are either very frequently used, or use large
Java (as opposed to native) objects, we should probably convert them
to NativeAllocationRegistry instead. But that's more work.

Bug: 18178237
Change-Id: I79bc0e8fa20af8f340418a6226022e0294d77f02
2016-05-10 15:33:53 -07:00
Richard Uhler
8e96faae78 Merge "Hold a ClassLoader reference in NativeAllocationRegistry." into nyc-dev 2016-05-09 15:50:30 +00:00