From 56f57ccbd4fbbf4d572cc966d1cb76d7ae7ad334 Mon Sep 17 00:00:00 2001 From: George Mount Date: Fri, 31 Jan 2014 00:56:09 +0000 Subject: Revert "Add Path trimming." Bug 12489442 This reverts commit 7fe03a267e6edb65142444765ce29ad5ff126052. Change-Id: Idf434d79683e170364838388c7933a8591f7f4d3 --- core/jni/android/graphics/Path.cpp | 50 -------------------------------------- 1 file changed, 50 deletions(-) (limited to 'core/jni/android/graphics/Path.cpp') diff --git a/core/jni/android/graphics/Path.cpp b/core/jni/android/graphics/Path.cpp index 76a0554..6bbf45a 100644 --- a/core/jni/android/graphics/Path.cpp +++ b/core/jni/android/graphics/Path.cpp @@ -515,54 +515,6 @@ public: delete[] approximation; return result; } - - static jlong trim(JNIEnv* env, jobject clazz, jlong inPathPtr, jlong outPathPtr, - jlong pathMeasurePtr, jfloat trimStart, jfloat trimEnd, jfloat trimOffset) { - SkPath* inPath = reinterpret_cast(inPathPtr); - SkPath* outPath = reinterpret_cast(outPathPtr); - SkPathMeasure* pathMeasure = reinterpret_cast(pathMeasurePtr); - if (trimStart == 0 && trimEnd == 1) { - if (outPath != NULL) { - *outPath = *inPath; - } - return reinterpret_cast(pathMeasure); - } - - bool modifyPath = (outPath == NULL); - if (modifyPath) { - outPath = new SkPath(); - } else { - outPath->reset(); - } - if (pathMeasure == NULL) { - pathMeasure = new SkPathMeasure(*inPath, false); - } - float length = pathMeasure->getLength(); - float start = (trimStart + trimOffset) * length; - float end = (trimEnd + trimOffset) * length; - - if (end > length && start <= length) { - pathMeasure->getSegment(start, length, outPath, true); - pathMeasure->getSegment(0, end - length, outPath, true); - } else { - if (start > length) { - start -= length; - end -= length; - } - pathMeasure->getSegment(start, end, outPath, true); - } - if (modifyPath) { - delete pathMeasure; - pathMeasure = NULL; - *inPath = *outPath; - delete outPath; - } - return reinterpret_cast(pathMeasure); - } - - static void destroyMeasure(JNIEnv* env, jobject clazz, jlong measure) { - delete reinterpret_cast(measure); - } }; static JNINativeMethod methods[] = { @@ -605,8 +557,6 @@ static JNINativeMethod methods[] = { {"native_transform","(JJ)V", (void*) SkPathGlue::transform__Matrix}, {"native_op","(JJIJ)Z", (void*) SkPathGlue::op}, {"native_approximate", "(JF)[F", (void*) SkPathGlue::approximate}, - {"native_destroyMeasure","(J)V", (void*) SkPathGlue::destroyMeasure}, - {"native_trim","(JJJFFF)J", (void*) SkPathGlue::trim}, }; int register_android_graphics_Path(JNIEnv* env) { -- cgit v1.1