Merge branch 'master' into honeycomb-release
diff --git a/res/drawable-xlarge-hdpi/app_market_generic.png b/res/drawable-xlarge-hdpi/app_market_generic.png
index f2738f7..c093e24 100644
--- a/res/drawable-xlarge-hdpi/app_market_generic.png
+++ b/res/drawable-xlarge-hdpi/app_market_generic.png
Binary files differ
diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java
index b75d08a..5d63f5a 100644
--- a/src/com/android/launcher2/AllApps3D.java
+++ b/src/com/android/launcher2/AllApps3D.java
@@ -149,9 +149,10 @@
RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
sc.setDepth(16, 16);
sc.setAlpha(8, 8);
- sRS = createRenderScript(sc);
+ sRS = createRenderScriptGL(sc);
} else {
- createRenderScript(sRS);
+ // Is this even possible?
+ setRenderScriptGL(sRS);
}
final DisplayMetrics metrics = getResources().getDisplayMetrics();
@@ -175,8 +176,8 @@
public void surrender() {
if (sRS != null) {
- sRS.contextSetSurface(0, 0, null);
- sRS.mMessageCallback = null;
+ sRS.setSurface(null, 0, 0);
+ sRS.setMessageHandler(null);
}
mSurrendered = true;
}
@@ -186,10 +187,10 @@
*/
@Override
protected void onDetachedFromWindow() {
- sRS.mMessageCallback = null;
+ sRS.setMessageHandler(null);
if (!mSurrendered) {
Log.i(TAG, "onDetachedFromWindow");
- destroyRenderScript();
+ destroyRenderScriptGL();
sRS = null;
sRollo = null;
super.onDetachedFromWindow();
@@ -216,7 +217,7 @@
super.surfaceDestroyed(holder);
// Without this, we leak mMessageCallback which leaks the context.
if (!mSurrendered) {
- sRS.mMessageCallback = null;
+ sRS.setMessageHandler(null);
}
// We may lose any callbacks that are pending, so make sure that we re-sync that
// on the next surfaceChanged.
@@ -256,7 +257,8 @@
Log.d(TAG, "sc " + sRS);
if (sRS != null) {
- sRS.mMessageCallback = mMessageProc = new AAMessage();
+ mMessageProc = new AAMessage();
+ sRS.setMessageHandler(mMessageProc);
}
//long endTime = SystemClock.uptimeMillis();
@@ -901,7 +903,7 @@
return -1;
}
- class AAMessage extends RenderScript.RSMessage {
+ class AAMessage extends RenderScript.RSMessageHandler {
public void run() {
sRollo.mScrollPos = ((float)mData[0]) / (1 << 16);
mVelocity = ((float)mData[1]) / (1 << 16);
@@ -944,12 +946,10 @@
private Allocation mHomeButtonPressed;
private Allocation[] mIcons;
- private int[] mIconIds;
- private Allocation mAllocIconIds;
+ private Allocation mAllocIcons;
private Allocation[] mLabels;
- private int[] mLabelIds;
- private Allocation mAllocLabelIds;
+ private Allocation mAllocLabels;
private Bitmap mSelectionBitmap;
private Canvas mSelectionCanvas;
@@ -966,13 +966,13 @@
void pause() {
if (sRS != null) {
- sRS.contextBindRootScript(null);
+ sRS.bindRootScript(null);
}
}
void resume() {
if (sRS != null) {
- sRS.contextBindRootScript(mScript);
+ sRS.bindRootScript(mScript);
}
}
@@ -984,7 +984,7 @@
mRes = res;
mWidth = width;
mHeight = height;
- mScript = new ScriptC_allapps(sRS, mRes, R.raw.allapps, true);
+ mScript = new ScriptC_allapps(sRS, mRes, R.raw.allapps);
initProgramVertex();
initProgramFragment();
@@ -992,9 +992,9 @@
initGl();
initData();
- mScript.bind_gIconIDs(mAllocIconIds);
- mScript.bind_gLabelIDs(mAllocLabelIds);
- sRS.contextBindRootScript(mScript);
+ mScript.bind_gIcons(mAllocIcons);
+ mScript.bind_gLabels(mAllocLabels);
+ sRS.bindRootScript(mScript);
}
public void initMesh() {
@@ -1070,7 +1070,7 @@
pvb.setTextureMatrixEnable(true);
ProgramVertex pv = pvb.create();
pv.bindAllocation(mPVA);
- sRS.contextBindProgramVertex(pv);
+ sRS.bindProgramVertex(pv);
mUniformAlloc = new ScriptField_VpConsts(sRS, 1);
mScript.bind_vpConstants(mUniformAlloc);
@@ -1231,12 +1231,10 @@
}
mIcons = new Allocation[count];
- mIconIds = new int[allocCount];
- mAllocIconIds = Allocation.createSized(sRS, Element.I32(sRS), allocCount);
+ mAllocIcons = Allocation.createSized(sRS, Element.ALLOCATION(sRS), allocCount);
mLabels = new Allocation[count];
- mLabelIds = new int[allocCount];
- mAllocLabelIds = Allocation.createSized(sRS, Element.I32(sRS), allocCount);
+ mAllocLabels = Allocation.createSized(sRS, Element.ALLOCATION(sRS), allocCount);
mScript.set_gIconCount(count);
for (int i=0; i < count; i++) {
@@ -1263,17 +1261,9 @@
Element.RGBA_8888(sRS), false);
mLabels[index] = Allocation.createFromBitmap(sRS, item.titleBitmap,
Element.A_8(sRS), false);
- mIconIds[index] = mIcons[index].getID();
- mLabelIds[index] = mLabels[index].getID();
}
private void uploadAppIcon(int index, ApplicationInfo item) {
- if (mIconIds[index] != mIcons[index].getID()) {
- throw new IllegalStateException("uploadAppIcon index=" + index
- + " mIcons[index].getID=" + mIcons[index].getID()
- + " mIconsIds[index]=" + mIconIds[index]
- + " item=" + item);
- }
mIcons[index].uploadToTexture(true, 0);
mLabels[index].uploadToTexture(true, 0);
}
@@ -1284,24 +1274,18 @@
*/
private void reallocAppsList(int count) {
Allocation[] icons = new Allocation[count];
- int[] iconIds = new int[count];
- mAllocIconIds = Allocation.createSized(sRS, Element.I32(sRS), count);
+ mAllocIcons = Allocation.createSized(sRS, Element.ALLOCATION(sRS), count);
Allocation[] labels = new Allocation[count];
- int[] labelIds = new int[count];
- mAllocLabelIds = Allocation.createSized(sRS, Element.I32(sRS), count);
+ mAllocLabels = Allocation.createSized(sRS, Element.ALLOCATION(sRS), count);
final int oldCount = sRollo.mScript.get_gIconCount();
System.arraycopy(mIcons, 0, icons, 0, oldCount);
- System.arraycopy(mIconIds, 0, iconIds, 0, oldCount);
System.arraycopy(mLabels, 0, labels, 0, oldCount);
- System.arraycopy(mLabelIds, 0, labelIds, 0, oldCount);
mIcons = icons;
- mIconIds = iconIds;
mLabels = labels;
- mLabelIds = labelIds;
}
/**
@@ -1312,9 +1296,7 @@
final int dest = index + 1;
System.arraycopy(mIcons, index, mIcons, dest, count);
- System.arraycopy(mIconIds, index, mIconIds, dest, count);
System.arraycopy(mLabels, index, mLabels, dest, count);
- System.arraycopy(mLabelIds, index, mLabelIds, dest, count);
createAppIconAllocations(index, item);
uploadAppIcon(index, item);
@@ -1330,17 +1312,13 @@
final int src = index + 1;
System.arraycopy(mIcons, src, mIcons, index, count);
- System.arraycopy(mIconIds, src, mIconIds, index, count);
System.arraycopy(mLabels, src, mLabels, index, count);
- System.arraycopy(mLabelIds, src, mLabelIds, index, count);
mScript.set_gIconCount(mScript.get_gIconCount() - 1);
final int last = mScript.get_gIconCount();
mIcons[last] = null;
- mIconIds[last] = 0;
mLabels[last] = null;
- mLabelIds[last] = 0;
}
/**
@@ -1348,12 +1326,14 @@
*/
private void saveAppsList() {
// WTF: how could mScript be not null but mAllocIconIds null b/2460740.
- if (mScript != null && mAllocIconIds != null) {
- mAllocIconIds.data(mIconIds);
- mAllocLabelIds.data(mLabelIds);
+ if (mScript != null && mAllocIcons != null) {
+ if (mIcons.length > 0) {
+ mAllocIcons.copyFrom(mIcons);
+ mAllocLabels.copyFrom(mLabels);
+ }
- mScript.bind_gIconIDs(mAllocIconIds);
- mScript.bind_gLabelIDs(mAllocLabelIds);
+ mScript.bind_gIcons(mAllocIcons);
+ mScript.bind_gLabels(mAllocLabels);
}
}
@@ -1462,14 +1442,6 @@
if (mIcons != null) {
Log.d(TAG, "sRollo.mIcons.length=" + mIcons.length);
}
- if (mIconIds != null) {
- Log.d(TAG, "sRollo.mIconIds.length=" + mIconIds.length);
- }
- Log.d(TAG, "sRollo.mIconIds=" + Arrays.toString(mIconIds));
- if (mLabelIds != null) {
- Log.d(TAG, "sRollo.mLabelIds.length=" + mLabelIds.length);
- }
- Log.d(TAG, "sRollo.mLabelIds=" + Arrays.toString(mLabelIds));
//Log.d(TAG, "sRollo.mState.newPositionX=" + mState.newPositionX);
//Log.d(TAG, "sRollo.mState.newTouchDown=" + mState.newTouchDown);
//Log.d(TAG, "sRollo.mState.flingVelocity=" + mState.flingVelocity);
@@ -1505,7 +1477,7 @@
sRollo.dumpState();
}
if (sRS != null) {
- sRS.contextDump(0);
+ sRS.contextDump();
}
}
}
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 8a8ef59..bbb5967 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -977,7 +977,6 @@
allAppsInfoTarget.setDragAndDropEnabled(false);
View marketButton = findViewById(R.id.market_button);
if (marketButton != null) {
- marketButton.setBackgroundColor(Color.RED);
allAppsInfoTarget.setHandle(marketButton);
}
}
@@ -1385,8 +1384,18 @@
// Do not call super here
mSavedInstanceState = savedInstanceState;
+ // Restore the current AllApps drawer tab
+ if (mAllAppsGrid != null && mAllAppsGrid instanceof AllAppsTabbed) {
+ String cur = savedInstanceState.getString("allapps_currentTab");
+ if (cur != null) {
+ AllAppsTabbed tabhost = (AllAppsTabbed) mAllAppsGrid;
+ tabhost.setCurrentTabByTag(cur);
+ }
+ }
+
+ // Restore the current customization drawer tab
if (mHomeCustomizationDrawer != null) {
- String cur = savedInstanceState.getString("currentTab");
+ String cur = savedInstanceState.getString("customize_currentTab");
if (cur != null) {
mHomeCustomizationDrawer.setCurrentTabByTag(cur);
}
@@ -1423,10 +1432,20 @@
outState.putLong(RUNTIME_STATE_PENDING_FOLDER_RENAME_ID, mFolderInfo.id);
}
+ // Save the current AllApps drawer tab
+ if (mAllAppsGrid != null && mAllAppsGrid instanceof AllAppsTabbed) {
+ AllAppsTabbed tabhost = (AllAppsTabbed) mAllAppsGrid;
+ String currentTabTag = tabhost.getCurrentTabTag();
+ if (currentTabTag != null) {
+ outState.putString("allapps_currentTab", currentTabTag);
+ }
+ }
+
+ // Save the current customization drawer tab
if (mHomeCustomizationDrawer != null) {
String currentTabTag = mHomeCustomizationDrawer.getCurrentTabTag();
if (currentTabTag != null) {
- outState.putString("currentTab", currentTabTag);
+ outState.putString("customize_currentTab", currentTabTag);
}
}
}
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 300bab5..fbc67d8 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -122,12 +122,14 @@
}
private void queueHolographicOutlineCreation() {
+ /* Temporarily disabling holographic outline creation.
// Generate the outline in the background
if (mHolographicOutline == null) {
Message m = sWorker.obtainMessage(MESSAGE_CREATE_HOLOGRAPHIC_OUTLINE);
m.obj = this;
sWorker.sendMessage(m);
}
+ */
}
public void applyFromApplicationInfo(ApplicationInfo info, PagedViewIconCache cache,
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java
index 4d4ccc2..89ed0ec 100644
--- a/src/com/android/launcher2/PagedViewWidget.java
+++ b/src/com/android/launcher2/PagedViewWidget.java
@@ -120,12 +120,14 @@
}
private void queueHolographicOutlineCreation() {
+ /* Temporarily disabling holographic outline creation.
// Generate the outline in the background
if (mHolographicOutline == null) {
Message m = sWorker.obtainMessage(MESSAGE_CREATE_HOLOGRAPHIC_OUTLINE);
m.obj = this;
sWorker.sendMessage(m);
}
+ */
}
public void applyFromAppWidgetProviderInfo(AppWidgetProviderInfo info,
diff --git a/src/com/android/launcher2/allapps.rs b/src/com/android/launcher2/allapps.rs
index 11851b8..bebc04d 100644
--- a/src/com/android/launcher2/allapps.rs
+++ b/src/com/android/launcher2/allapps.rs
@@ -24,8 +24,8 @@
rs_program_store gPS;
rs_mesh gSMCell;
-rs_allocation *gIconIDs;
-rs_allocation *gLabelIDs;
+rs_allocation *gIcons;
+rs_allocation *gLabels;
typedef struct VpConsts {
rs_matrix4x4 Proj;
@@ -297,25 +297,25 @@
vpConstants->ImgSize.x = rsAllocationGetDimX(gSelectedIconTexture);
vpConstants->ImgSize.y = rsAllocationGetDimY(gSelectedIconTexture);
vpConstants->Position.y = y - (rsAllocationGetDimY(gSelectedIconTexture)
- - rsAllocationGetDimY(gIconIDs[iconNum])) * 0.5f;
+ - rsAllocationGetDimY(gIcons[iconNum])) * 0.5f;
rsAllocationMarkDirty(g_VPConstAlloc);
rsgDrawMesh(gSMCell);
}
rsgBindProgramFragment(gPFTexMip);
- vpConstants->ImgSize.x = rsAllocationGetDimX(gIconIDs[iconNum]);
- vpConstants->ImgSize.y = rsAllocationGetDimY(gIconIDs[iconNum]);
+ vpConstants->ImgSize.x = rsAllocationGetDimX(gIcons[iconNum]);
+ vpConstants->ImgSize.y = rsAllocationGetDimY(gIcons[iconNum]);
vpConstants->Position.y = y - 0.2f;
rsAllocationMarkDirty(g_VPConstAlloc);
- rsgBindTexture(gPFTexMip, 0, gIconIDs[iconNum]);
+ rsgBindTexture(gPFTexMip, 0, gIcons[iconNum]);
rsgDrawMesh(gSMCell);
rsgBindProgramFragment(gPFTexMipAlpha);
- vpConstants->ImgSize.x = rsAllocationGetDimX(gLabelIDs[iconNum]);
- vpConstants->ImgSize.y = rsAllocationGetDimY(gLabelIDs[iconNum]);
+ vpConstants->ImgSize.x = rsAllocationGetDimX(gLabels[iconNum]);
+ vpConstants->ImgSize.y = rsAllocationGetDimY(gLabels[iconNum]);
vpConstants->Position.y = y - 64.f - 0.2f;
rsAllocationMarkDirty(g_VPConstAlloc);
- rsgBindTexture(gPFTexMipAlpha, 0, gLabelIDs[iconNum]);
+ rsgBindTexture(gPFTexMipAlpha, 0, gLabels[iconNum]);
rsgDrawMesh(gSMCell);
}
iconNum++;