7 Commits

Author SHA1 Message Date
Doris Liu
b35da39060 Allow leading spaces in path string (to keep behavior consistent)
Bug: 28132454
Change-Id: Iee799c13a85738db3d6940aca0fe917f284fa651
2016-04-12 21:38:07 +00:00
Doris Liu
0a1a5167be Improve error logging for parsing failures
Bug: 27043594
Change-Id: I901b65f734c49444a78e0714e007e15e2340ab9d
2016-04-08 18:01:54 +00: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
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
Doris Liu
1e67f08963 Add error check for float parsing and fix tests
Change-Id: Ia4f4863d415536b3796edbcdb83c951b6cff02cf
2015-11-13 15:58:49 -08:00
Doris Liu
cdd23f9d45 Add hooks in JNI to start using native path parsing
Change-Id: Iaa0d3c2c1936c248146ed7f186a13e8e79be818e
2015-11-11 17:54:52 -08:00
Doris Liu
30bcf69df9 VectorDrawable native rendering - Step 1 of MANY
Implement path parsing from string to skia path in native. The parsing
contains two main stages:
1) Parse string into a list of nodes that contains one operation (such
   as move) and a vector of floats as params for that operation.
2) Interpret the operations defined in the nodes into SkPath operations,
   and create a skia path

Also provided unit test for parsing a string path into a list of nodes,
and then to a skia path.

Change-Id: I0ce13df5e3bb90987dcdc80fe8b039af175ad2e2
2015-11-10 15:46:06 -08:00