History log of /frameworks/base/libs/hwui/VectorDrawable.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
028029730bf2d177f84316d2d444d409eba4b6cb 27-May-2016 Doris Liu <tianliu@google.com> 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
f8d131cc8dc4ef675b8f8fc57dcc26062d575d32 30-Apr-2016 Doris Liu <tianliu@google.com> Count native allocation for VD against Java heap

There are two parts to VD's native allocation:
1) VD's internal data structure (i.e. groups, paths, etc that make
up of the VD tree). This structure can change, when a VD is used
to load a different drawable resource.
2) Two bitmap caches, not both of which will necessarily be allocated
The size of the bitmap cache depends on canvas matrix and drawable
bounds, and therefore can often change.

We need to count the native allocation from the above against Java heap.

Bug: 26269056
Change-Id: If833aedcf7f3efe00ea73a41ddccb1b48066ffd8
b35da390601e3c24e777d72daacd8dbeb4d1d9c4 12-Apr-2016 Doris Liu <tianliu@google.com> Allow leading spaces in path string (to keep behavior consistent)

Bug: 28132454
Change-Id: Iee799c13a85738db3d6940aca0fe917f284fa651
1d8e194661085f9a18ab1b3cd12f9e19d3a86be5 03-Mar-2016 Doris Liu <tianliu@google.com> Make AVD thread safe

This CL introduces staging properties to VectorDrawable, which holds
properties coming from UI thread. When staging properties are changed,
they are marked dirty, and the staging properties then get pushed to
RenderThread at sync point. In cases where no staging property has
been changed, at sync point we sync the render thread properties back
to staging properties to reflect the latest render thread animation
value change.

Also, update Vector Drawable bitmap only when it's dirty

Bug: 27343970
Bug: 27385912
Bug: 27263667
Bug: 27927674
Bug: 27774383

Change-Id: Ia864f5400a53a08dbfb284fae581fb1aac4fff87
71e806b2f464b0ac85367fe008b554b44e4c5812 16-Mar-2016 Tenghui Zhu <ztenghui@google.com> Merge "Add fillType support to VectorDrawable" into nyc-dev
46591f4a2dbd785bcae2b82bb490e78208605ec8 15-Mar-2016 Teng-Hui Zhu <ztenghui@google.com> Add fillType support to VectorDrawable

Default as non-zero, which is the same as SVG.

Change-Id: Id20e6d3493bb4d2b4b65d7f6cdb13586631c40e4
24ba1251583dc637ff1699550aa99811e886b4cf 16-Mar-2016 Doris Liu <tianliu@google.com> Workaround for PathMeasure.getSegment() behavior change

SkPathMeasure::getSegment(SkScalar startD, SkScalar stopD, SkPath* dst,
bool startWithMoveTo) in SkPathMeasure used to ignore the case when
startD == stopD in MNC release. In NYC, the same paramaters would yield
a tiny segment, which leaves undesirable artifacts as shown in the bug

Bug: 27665826
Change-Id: I8289dc32773fd55d686458183af44ff072866c6e
ef062ebd20032efe697741d6c3dfd1faec54f590 05-Feb-2016 Doris Liu <tianliu@google.com> 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
766431aa57c16ece8842287a92b2e7208e3b8ac3 04-Feb-2016 Doris Liu <tianliu@google.com> Revert "Revert "VectorDrawable native rendering - Step 4 of MANY""

This reverts commit 5a11e8d0ba21624025b89ac63bbd18befa55be0e.

Change-Id: I7a48b59c4f930dad65ddc8590c25a12636244ea2
5a11e8d0ba21624025b89ac63bbd18befa55be0e 04-Feb-2016 Doris Liu <tianliu@google.com> Revert "VectorDrawable native rendering - Step 4 of MANY"

b/26949340 and b/26975469, b/26975079 as well

This reverts commit f276acd98457bcaabc9e79a17a736b3b484f005e.

Change-Id: I4b55177daf0d289bc03604c71fd4bf579f65073a
777bf85c1631acdc81d88d841266e585caed7e15 03-Feb-2016 Florin Malita <fmalita@google.com> Remove remaining references to SkCanvas::SaveFlags

One SkCanvas save flag reference snuck back in after the last
cleanup. Convert to the new SaveFlags enum.

Change-Id: I9ba4b01a19bbb80276c84d30fd0d7b9513892cf9
f276acd98457bcaabc9e79a17a736b3b484f005e 07-Jan-2016 Doris Liu <tianliu@google.com> VectorDrawable native rendering - Step 4 of MANY

This CL runs VectorDrawable animation on RenderThread. The changes in this CL
- 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.

- Implement reverse and reset for AVD.

Change-Id: I2df1d754f2db0ad098d9c15dde4bb2bdfafc2315
28d4ea558435b1b245bd5774c0db056a2ffdb385 28-Jan-2016 Teng-Hui Zhu <ztenghui@google.com> Fix redundant drawPath call

Change-Id: I17dab39e0ca60f64543053381d8677f1a31507c0
dbee9bb342cdfaa5155b1918f90262c05e2464cb 15-Dec-2015 Teng-Hui Zhu <ztenghui@google.com> 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.


Change-Id: Ibdc564ddb4a7ee0133c6141c4784782f0c93ce0e
eecff56fed5dd5206acfbc5007b4912081b36d3b 21-Dec-2015 Florin Malita <fmalita@google.com> Add internal Canvas save flags

Skia's SkCanvas::SaveFlags are being deprecated. This CL introduces
the equivalent android::SaveFlags, converts all internal clients to
the new enum, and switches the saveLayer glue to the
SaveLayerRec-based API.

Change-Id: Icb1785f4e7c0f652b1f04b34a1e3ccb063c408f3
c2de46fadd4ca9c6aa2d9dd7a65b161b28fc6f3b 21-Jan-2016 Doris Liu <tianliu@google.com> Create SkCanvas on the stack to avoid leaking memeory

Bug: 26447978
Change-Id: Ied022c103c3b08e9cfc3cb775a8c95fd5461e81d
e410a357f50651065a0cb39d8de809c861b56f75 14-Jan-2016 Doris Liu <tianliu@google.com> Properly handle the negative scaling factor of canvas in VectorDrawable

Bug: 26489687
Change-Id: I91cce34759fbbac206cd59f4636fd92194396c87
a0e61572ab2ec23f1329a04f6a8065721a1efbdb 29-Dec-2015 Doris Liu <tianliu@google.com> VectorDrawable: Use the matrix scale only if the matrix has no rotation or skew.

When canvas is rotated or skewed, the scale factor is affected.
Conservatively reset the scale used to modify path stroke size to 1 in these
cases, since the image will be somewhat blurry anyway with rotation / skew..


Change-Id: I6dff1bca5fac5500fa688c68f8b81b6212526b6b
4bbc2931263b232fba61807fca00e127573eff42 02-Dec-2015 Doris Liu <tianliu@google.com> 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