diff options
author | Joe Onorato <joeo@android.com> | 2009-08-08 22:32:00 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-08-08 22:32:00 -0700 |
commit | 1feb3a8d70b7182d9113c01a652e54486efb5092 (patch) | |
tree | 514ded05ec282ae57e7b569d25af22a1f7bf02e5 /src/com/android/launcher2/IntAllocation.java | |
parent | 43e7bcf0ad7b487df9244bc5491695b130d331c7 (diff) | |
download | android_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.java | 20 |
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; |