Apply contextStart consistently in getRunAdvance

The contextStart needs to be applied to all offsets relative to the
actual start of context. The code was missing "offset", which caused
mischief especially in mixed LTR and RTL text.

Bug: 21573666
Change-Id: I47a1b6cde5862442b9c7236ee72b2ceb0df9b2e9
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 63395ed..d14fc0f 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -1055,7 +1055,8 @@
         // TODO performance: optimize JNI array access
         jchar* textArray = env->GetCharArrayElements(text, NULL);
         jfloat result = doRunAdvance(paint, typeface, textArray + contextStart,
-                start - contextStart, end - start, contextEnd - contextStart, isRtl, offset);
+                start - contextStart, end - start, contextEnd - contextStart, isRtl,
+                offset - contextStart);
         env->ReleaseCharArrayElements(text, textArray, JNI_ABORT);
         return result;
     }