summaryrefslogtreecommitdiff
path: root/libs/hwui/PathParser.h
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2015-11-12 15:57:45 -0800
committerDoris Liu <tianliu@google.com>2015-11-13 15:58:49 -0800
commit1e67f08963cc245660049b6a588483a148955e08 (patch)
tree96757b4b8fe766323e03dbe82ae9584ef1201716 /libs/hwui/PathParser.h
parent8b8be50c640a13b98d364b3f36962d9cf185d6d9 (diff)
Add error check for float parsing and fix tests
Change-Id: Ia4f4863d415536b3796edbcdb83c951b6cff02cf
Diffstat (limited to 'libs/hwui/PathParser.h')
-rw-r--r--libs/hwui/PathParser.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/hwui/PathParser.h b/libs/hwui/PathParser.h
index d30bb0f1b973..a9c1e60dae2e 100644
--- a/libs/hwui/PathParser.h
+++ b/libs/hwui/PathParser.h
@@ -23,17 +23,25 @@
#include <android/log.h>
#include <cutils/compiler.h>
+#include <string>
+
namespace android {
namespace uirenderer {
+
class PathParser {
public:
+ struct ANDROID_API ParseResult {
+ bool failureOccurred = false;
+ std::string failureMessage;
+ };
/**
* Parse the string literal and create a Skia Path. Return true on success.
*/
- ANDROID_API static bool parseStringForSkPath(SkPath* outPath, const char* pathStr,
- size_t strLength);
- static void getPathDataFromString(PathData* outData, const char* pathStr, size_t strLength);
+ ANDROID_API static void parseStringForSkPath(SkPath* outPath, ParseResult* result,
+ const char* pathStr, size_t strLength);
+ static void getPathDataFromString(PathData* outData, ParseResult* result,
+ const char* pathStr, size_t strLength);
static void dump(const PathData& data);
};