start rewriting rollo so it's a little more parameterized.
diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java
index 7bf0c7c..0a522ae 100644
--- a/src/com/android/launcher2/AllAppsView.java
+++ b/src/com/android/launcher2/AllAppsView.java
@@ -243,6 +243,12 @@
public static final int STATE_COUNT = 8;
public static final int STATE_TOUCH = 9;
+ static final int ALLOC_PARAMS = 0;
+ static final int ALLOC_STATE = 1;
+ static final int ALLOC_SCRATCH = 2;
+ static final int ALLOC_ICON_IDS = 3;
+ static final int ALLOC_LABEL_IDS = 4;
+
public RolloRS() {
}
@@ -291,6 +297,7 @@
private Sampler mSamplerText;
private ProgramStore mPSBackground;
private ProgramStore mPSText;
+ private ProgramFragment mPFDebug;
private ProgramFragment mPFImages;
private ProgramFragment mPFText;
private ProgramVertex mPV;
@@ -312,6 +319,18 @@
private int[] mAllocScratchBuf;
private Allocation mAllocScratch;
+ Params mParams;
+
+ class Params extends IntAllocation {
+ Params(RenderScript rs) {
+ super(rs);
+ }
+ @AllocationIndex(0) public int bubbleWidth;
+ @AllocationIndex(1) public int bubbleHeight;
+ @AllocationIndex(2) public int bubbleBitmapWidth;
+ @AllocationIndex(3) public int bubbleBitmapHeight;
+ }
+
private void initNamed() {
Sampler.Builder sb = new Sampler.Builder(mRS);
sb.setMin(Sampler.Value.LINEAR);//_MIP_LINEAR);
@@ -324,6 +343,9 @@
sb.setMag(Sampler.Value.NEAREST);
mSamplerText = sb.create();
+ ProgramFragment.Builder dbg = new ProgramFragment.Builder(mRS, null, null);
+ mPFDebug = dbg.create();
+ mPFDebug.setName("PFDebug");
ProgramFragment.Builder bf = new ProgramFragment.Builder(mRS, null, null);
bf.setTexEnable(true, 0);
@@ -380,6 +402,8 @@
}
private void initIcons(int count) {
+ mParams = new Params(mRS);
+
mIcons = new Allocation[count];
mAllocIconIDBuf = new int[count];
mAllocIconID = Allocation.createSized(mRS,
@@ -394,6 +418,12 @@
final Utilities.BubbleText bubble = new Utilities.BubbleText(getContext());
+ mParams.bubbleWidth = bubble.getBubbleWidth();
+ mParams.bubbleHeight = bubble.getMaxBubbleHeight();
+ mParams.bubbleBitmapWidth = bubble.getBitmapWidth();
+ mParams.bubbleBitmapHeight = bubble.getBitmapHeight();
+ mParams.save();
+
for (int i=0; i<count; i++) {
mIcons[i] = Allocation.createFromBitmapResource(
mRS, mRes, R.raw.maps, ie8888, true);
@@ -430,10 +460,12 @@
mAllocStateBuf = new int[] {0, 0, 0, 8, 0, 0, -1, 0, mAllocIconIDBuf.length, 0, 0};
mAllocState = Allocation.createSized(mRS,
Element.USER_I32, mAllocStateBuf.length);
- mScript.bindAllocation(mAllocState, 0);
- mScript.bindAllocation(mAllocIconID, 1);
- mScript.bindAllocation(mAllocScratch, 2);
- mScript.bindAllocation(mAllocLabelID, 3);
+
+ mScript.bindAllocation(mParams.getAllocation(), ALLOC_PARAMS);
+ mScript.bindAllocation(mAllocState, ALLOC_STATE);
+ mScript.bindAllocation(mAllocIconID, ALLOC_ICON_IDS);
+ mScript.bindAllocation(mAllocScratch, ALLOC_SCRATCH);
+ mScript.bindAllocation(mAllocLabelID, ALLOC_LABEL_IDS);
setPosition(0);
setZoom(1);