aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2012-09-12 15:36:25 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-12 15:36:25 -0700
commita698a37f8d0ed85cdfa4bd9041514e780ccea54a (patch)
tree8a5b49379df2e1f054b39acaf271bd51648c0682
parent856834d2d3455e16bdf2983673d1417c8fe886d3 (diff)
parent36a671ac9719f1b1f092d804a74cc261d8ec54b9 (diff)
downloadlatinime-a698a37f8d0ed85cdfa4bd9041514e780ccea54a.tar.gz
latinime-a698a37f8d0ed85cdfa4bd9041514e780ccea54a.tar.xz
latinime-a698a37f8d0ed85cdfa4bd9041514e780ccea54a.zip
am 36a671ac: am 9182daf9: Output detailed log in ProximityInfoState
* commit '36a671ac9719f1b1f092d804a74cc261d8ec54b9': Output detailed log in ProximityInfoState
-rw-r--r--native/jni/src/proximity_info_state.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/native/jni/src/proximity_info_state.cpp b/native/jni/src/proximity_info_state.cpp
index f21d00b1f..208b69356 100644
--- a/native/jni/src/proximity_info_state.cpp
+++ b/native/jni/src/proximity_info_state.cpp
@@ -98,6 +98,10 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
mDistanceCache.clear();
mNearKeysVector.clear();
}
+ if (DEBUG_GEO_FULL) {
+ AKLOGI("Init ProximityInfoState: reused points = %d, last input size = %d",
+ pushTouchPointStartIndex, lastSavedInputSize);
+ }
mInputSize = 0;
if (xCoordinates && yCoordinates) {
@@ -109,6 +113,9 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
lastInputIndex = i;
}
}
+ if (DEBUG_GEO_FULL) {
+ AKLOGI("Init ProximityInfoState: last input index = %d", lastInputIndex);
+ }
// Working space to save near keys distances for current, prev and prevprev input point.
NearKeysDistanceMap nearKeysDistances[3];
// These pointers are swapped for each inputs points.
@@ -119,6 +126,9 @@ void ProximityInfoState::initInputParams(const int pointerId, const float maxPoi
for (int i = pushTouchPointStartIndex; i <= lastInputIndex; ++i) {
// Assuming pointerId == 0 if pointerIds is null.
const int pid = pointerIds ? pointerIds[i] : 0;
+ if (DEBUG_GEO_FULL) {
+ AKLOGI("Init ProximityInfoState: (%d)PID = %d", i, pid);
+ }
if (pointerId == pid) {
const int c = isGeometric ? NOT_A_COORDINATE : getPrimaryCharAt(i);
const int x = proximityOnly ? NOT_A_COORDINATE : xCoordinates[i];
@@ -367,6 +377,13 @@ bool ProximityInfoState::pushTouchPoint(const int inputIndex, const int nodeChar
if (isLastPoint) {
if (size > 0 && getDistanceFloat(x, y, mInputXs.back(), mInputYs.back())
< mProximityInfo->getMostCommonKeyWidth() * LAST_POINT_SKIP_DISTANCE_SCALE) {
+ if (DEBUG_GEO_FULL) {
+ AKLOGI("p0: size = %zd, x = %d, y = %d, lx = %d, ly = %d, dist = %f, "
+ "width = %f", size, x, y, mInputXs.back(), mInputYs.back(),
+ getDistanceFloat(x, y, mInputXs.back(), mInputYs.back()),
+ mProximityInfo->getMostCommonKeyWidth()
+ * LAST_POINT_SKIP_DISTANCE_SCALE);
+ }
return popped;
} else if (size > 1) {
int minChar = 0;
@@ -380,6 +397,10 @@ bool ProximityInfoState::pushTouchPoint(const int inputIndex, const int nodeChar
}
NearKeysDistanceMap::const_iterator itPP =
prevNearKeysDistances->find(minChar);
+ if (DEBUG_GEO_FULL) {
+ AKLOGI("p1: char = %c, minDist = %f, prevNear key minDist = %f",
+ minChar, itPP->second, minDist);
+ }
if (itPP != prevNearKeysDistances->end() && minDist > itPP->second) {
return popped;
}