summaryrefslogtreecommitdiff
path: root/libs/hwui/PathParser.h
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2015-11-04 14:56:24 -0800
committerDoris Liu <tianliu@google.com>2015-11-10 15:46:06 -0800
commit30bcf69df9cfae40b621335958656cb0e4afd7d5 (patch)
treed4cc05d731a54d19775a0fd5245d0764a5156bcf /libs/hwui/PathParser.h
parent429c5b93ff66e82fa3fd65475489fde133c66002 (diff)
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
Diffstat (limited to 'libs/hwui/PathParser.h')
-rw-r--r--libs/hwui/PathParser.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/libs/hwui/PathParser.h b/libs/hwui/PathParser.h
new file mode 100644
index 000000000000..6dc7ee193197
--- /dev/null
+++ b/libs/hwui/PathParser.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_HWUI_PATHPARSER_H
+#define ANDROID_HWUI_PATHPARSER_H
+
+#include "VectorDrawablePath.h"
+
+#include <jni.h>
+#include <android/log.h>
+
+namespace android {
+namespace uirenderer {
+
+class PathParser {
+public:
+ static void parseStringForSkPath(SkPath* outPath, const char* pathStr, size_t strLength);
+ static void getPathDataFromString(PathData* outData, const char* pathStr, size_t strLength);
+ static void dump(const PathData& data);
+};
+
+}; // namespace uirenderer
+}; // namespace android
+#endif //ANDROID_HWUI_PATHPARSER_H