PathParser.h revision cdd23f9d45ea2974c3f295754b89f5462bdd2c0d
130bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu/* 230bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * Copyright (C) 2015 The Android Open Source Project 330bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * 430bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * Licensed under the Apache License, Version 2.0 (the "License"); 530bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * you may not use this file except in compliance with the License. 630bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * You may obtain a copy of the License at 730bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * 830bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * http://www.apache.org/licenses/LICENSE-2.0 930bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * 1030bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * Unless required by applicable law or agreed to in writing, software 1130bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * distributed under the License is distributed on an "AS IS" BASIS, 1230bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1330bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * See the License for the specific language governing permissions and 1430bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu * limitations under the License. 1530bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu */ 1630bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu 1730bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu#ifndef ANDROID_HWUI_PATHPARSER_H 1830bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu#define ANDROID_HWUI_PATHPARSER_H 1930bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu 2030bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu#include "VectorDrawablePath.h" 2130bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu 2230bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu#include <jni.h> 2330bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu#include <android/log.h> 24cdd23f9d45ea2974c3f295754b89f5462bdd2c0dDoris Liu#include <cutils/compiler.h> 2530bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu 2630bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liunamespace android { 2730bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liunamespace uirenderer { 2830bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu 2930bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liuclass PathParser { 3030bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liupublic: 31cdd23f9d45ea2974c3f295754b89f5462bdd2c0dDoris Liu /** 32cdd23f9d45ea2974c3f295754b89f5462bdd2c0dDoris Liu * Parse the string literal and create a Skia Path. Return true on success. 33cdd23f9d45ea2974c3f295754b89f5462bdd2c0dDoris Liu */ 34cdd23f9d45ea2974c3f295754b89f5462bdd2c0dDoris Liu ANDROID_API static bool parseStringForSkPath(SkPath* outPath, const char* pathStr, 35cdd23f9d45ea2974c3f295754b89f5462bdd2c0dDoris Liu size_t strLength); 3630bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu static void getPathDataFromString(PathData* outData, const char* pathStr, size_t strLength); 3730bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu static void dump(const PathData& data); 3830bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu}; 3930bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu 4030bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu}; // namespace uirenderer 4130bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu}; // namespace android 4230bcf69df9cfae40b621335958656cb0e4afd7d5Doris Liu#endif //ANDROID_HWUI_PATHPARSER_H 43