summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/IntAllocation.java
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2009-08-08 22:32:00 -0700
committerJoe Onorato <joeo@android.com>2009-08-08 22:32:00 -0700
commit1feb3a8d70b7182d9113c01a652e54486efb5092 (patch)
tree514ded05ec282ae57e7b569d25af22a1f7bf02e5 /src/com/android/launcher2/IntAllocation.java
parent43e7bcf0ad7b487df9244bc5491695b130d331c7 (diff)
downloadandroid_packages_apps_Trebuchet-1feb3a8d70b7182d9113c01a652e54486efb5092.tar.gz
android_packages_apps_Trebuchet-1feb3a8d70b7182d9113c01a652e54486efb5092.tar.bz2
android_packages_apps_Trebuchet-1feb3a8d70b7182d9113c01a652e54486efb5092.zip
Start rewriting the motion event tracking.
It's just tracking the finger with no fling.
Diffstat (limited to 'src/com/android/launcher2/IntAllocation.java')
-rw-r--r--src/com/android/launcher2/IntAllocation.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/com/android/launcher2/IntAllocation.java b/src/com/android/launcher2/IntAllocation.java
index 3d96c5eee..ab9d9155d 100644
--- a/src/com/android/launcher2/IntAllocation.java
+++ b/src/com/android/launcher2/IntAllocation.java
@@ -19,6 +19,7 @@ package com.android.launcher2;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
+import android.util.Log;
import java.lang.reflect.Field;
@@ -45,6 +46,25 @@ public class IntAllocation {
}
}
mBuffer = new int[maxIndex+1];
+ if (true) {
+ // helpful debugging check
+ for (Field f: fields) {
+ AllocationIndex index = f.getAnnotation(AllocationIndex.class);
+ if (index != null) {
+ int i = index.value();
+ if (mBuffer[i] != 0) {
+ throw new RuntimeException("@AllocationIndex on field in class "
+ + this.getClass().getName() + " with duplicate value "
+ + i + " for field " + f.getName() + ". The other field is "
+ + fields[mBuffer[i]-1].getName() + '.');
+ }
+ mBuffer[i] = i+1;
+ }
+ }
+ for (int i=0; i<mBuffer.length; i++) {
+ mBuffer[i] = 0;
+ }
+ }
mAlloc = Allocation.createSized(mRS, Element.USER_I32, mBuffer.length);
}
int[] buf = mBuffer;