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
diff --git a/core/jni/android_graphics_drawable_VectorDrawable.cpp b/core/jni/android_graphics_drawable_VectorDrawable.cpp
index 0de6549..9e69f79 100644
--- a/core/jni/android_graphics_drawable_VectorDrawable.cpp
+++ b/core/jni/android_graphics_drawable_VectorDrawable.cpp
@@ -92,14 +92,14 @@
 /**
  * Draw
  */
-static void draw(JNIEnv* env, jobject, jlong treePtr, jlong canvasPtr,
+static int draw(JNIEnv* env, jobject, jlong treePtr, jlong canvasPtr,
         jlong colorFilterPtr, jobject jrect, jboolean needsMirroring, jboolean canReuseCache) {
     VectorDrawable::Tree* tree = reinterpret_cast<VectorDrawable::Tree*>(treePtr);
     Canvas* canvas = reinterpret_cast<Canvas*>(canvasPtr);
     SkRect rect;
     GraphicsJNI::jrect_to_rect(env, jrect, &rect);
     SkColorFilter* colorFilter = reinterpret_cast<SkColorFilter*>(colorFilterPtr);
-    tree->draw(canvas, colorFilter, rect, needsMirroring, canReuseCache);
+    return tree->draw(canvas, colorFilter, rect, needsMirroring, canReuseCache);
 }
 
 /**
@@ -349,7 +349,7 @@
         {"nGetRootAlpha", "!(J)F", (void*)getRootAlpha},
         {"nSetAllowCaching", "!(JZ)V", (void*)setAllowCaching},
 
-        {"nDraw", "(JJJLandroid/graphics/Rect;ZZ)V", (void*)draw},
+        {"nDraw", "(JJJLandroid/graphics/Rect;ZZ)I", (void*)draw},
         {"nCreateFullPath", "!()J", (void*)createEmptyFullPath},
         {"nCreateFullPath", "!(J)J", (void*)createFullPath},
         {"nUpdateFullPathProperties", "!(JFIFIFFFFFIII)V", (void*)updateFullPathPropertiesAndStrokeStyles},