From 60a55bbf54998afe9a0b766781c1dfada0d53518 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Fri, 18 Jun 2010 15:11:19 -0700 Subject: [PATCH] Code cleanup possible with new reflected classes. Change-Id: If9e79383722c0df997526717c52ded4921b6663e --- res/raw/allapps.rs | 71 ++++------ res/raw/allapps_bc.bc | Bin 11644 -> 11612 bytes src/com/android/launcher2/AllApps3D.java | 115 ++++++---------- .../android/launcher2/ScriptC_Allapps.java | 127 ++++++------------ .../launcher2/ScriptField_VpConsts.java | 2 +- 5 files changed, 112 insertions(+), 203 deletions(-) diff --git a/res/raw/allapps.rs b/res/raw/allapps.rs index d947613ba9..1465308115 100644 --- a/res/raw/allapps.rs +++ b/res/raw/allapps.rs @@ -14,15 +14,10 @@ int ROWS_PER_PAGE_PORTRAIT; int COLUMNS_PER_PAGE_LANDSCAPE; int ROWS_PER_PAGE_LANDSCAPE; -float gNewPositionX; -int gNewTouchDown; -float gFlingVelocity; int gIconCount; int gSelectedIconIndex = -1; rs_allocation gSelectedIconTexture; -float gZoomTarget; rs_allocation gHomeButton; -float gTargetPos; rs_program_fragment gPFTexNearest; rs_program_fragment gPFTexMip; @@ -43,13 +38,8 @@ typedef struct VpConsts { VpConsts_t *vpConstants; -#pragma rs export_var(COLUMNS_PER_PAGE_PORTRAIT, ROWS_PER_PAGE_PORTRAIT, COLUMNS_PER_PAGE_LANDSCAPE, ROWS_PER_PAGE_LANDSCAPE, gNewPositionX, gNewTouchDown, gFlingVelocity, gIconCount, gSelectedIconIndex, gSelectedIconTexture, gZoomTarget, gHomeButton, gTargetPos, gPFTexNearest, gPFTexMip, gPFTexMipAlpha, gPVCurve, gPS, gSMCell, gIconIDs, gLabelIDs, vpConstants) -#pragma rs export_func(resetHWWar, move, moveTo, setZoom, fling) - - -void debugAll() -{ -} +#pragma rs export_var(COLUMNS_PER_PAGE_PORTRAIT, ROWS_PER_PAGE_PORTRAIT, COLUMNS_PER_PAGE_LANDSCAPE, ROWS_PER_PAGE_LANDSCAPE, gIconCount, gSelectedIconIndex, gSelectedIconTexture, gHomeButton, gTargetPos, gPFTexNearest, gPFTexMip, gPFTexMipAlpha, gPVCurve, gPS, gSMCell, gIconIDs, gLabelIDs, vpConstants) +#pragma rs export_func(move, moveTo, setZoom, fling) // Attraction to center values from page edge to page center. @@ -57,10 +47,12 @@ static float g_AttractionTable[9] = {20.f, 20.f, 20.f, 10.f, -10.f, -20.f, -20.f static float g_FrictionTable[9] = {10.f, 10.f, 11.f, 15.f, 15.f, 11.f, 10.f, 10.f, 10.f}; static float g_PhysicsTableSize = 7; +static float gZoomTarget; +static float gTargetPos; static float g_PosPage = 0.f; static float g_PosVelocity = 0.f; static float g_LastPositionX = 0.f; -static int g_LastTouchDown = 0; +static bool g_LastTouchDown = false; static float g_DT; static int64_t g_LastTime; static int g_PosMax; @@ -79,14 +71,6 @@ static int g_Rows; // Drawing constants, should be parameters ====== #define VIEW_ANGLE 1.28700222f -static int g_DrawLastFrame; -static int lastFrame(int draw) { - // We draw one extra frame to work around the last frame post bug. - // We also need to track if we drew the last frame to deal with large DT - // in the physics. - g_DrawLastFrame = draw; - return draw; -} static void updateReadback() { if ((g_OldPosPage != g_PosPage) || @@ -105,16 +89,12 @@ static void updateReadback() { } } -void setColor(float r, float g, float b, float a) { -} void init() { } -void resetHWWar() { -} -void move() { +void move(float newPos) { if (g_LastTouchDown) { - float dx = -(gNewPositionX - g_LastPositionX); + float dx = -(newPos - g_LastPositionX); g_PosVelocity = 0; g_PosPage += dx * 5.2f; @@ -122,26 +102,34 @@ void move() { float pmax = g_PosMax + 0.49f; g_PosPage = clamp(g_PosPage, pmin, pmax); } - g_LastTouchDown = gNewTouchDown; - g_LastPositionX = gNewPositionX; + g_LastTouchDown = true; + g_LastPositionX = newPos; g_MoveToTime = 0; } -void moveTo() { +void moveTo(float targetPos) { + gTargetPos = targetPos; g_MoveToTime = g_MoveToTotalTime; g_PosVelocity = 0; g_MoveToOldPos = g_PosPage; } -void setZoom() { - g_Zoom = gZoomTarget; - g_DrawLastFrame = 1; +void setZoom(float z, /*bool*/ int animate) { + gZoomTarget = z; + if (gZoomTarget < 0.001f) { + gZoomTarget = 0; + } + if (!animate) { + g_Zoom = gZoomTarget; + } updateReadback(); } -void fling() { - g_LastTouchDown = 0; - g_PosVelocity = -gFlingVelocity * 4; +void fling(float newPos, float vel) { + move(newPos); + + g_LastTouchDown = false; + g_PosVelocity = -vel * 4; float av = fabs(g_PosVelocity); float minVel = 3.5f; @@ -347,13 +335,8 @@ int root() g_DT = (newTime - g_LastTime) * 0.001f; g_LastTime = newTime; - if (!g_DrawLastFrame) { - // If we stopped rendering we cannot use DT. - // assume 30fps in this case. - g_DT = 0.033f; - } // physics may break if DT is large. - g_DT = min(g_DT, 0.2f); + g_DT = min(g_DT, 0.1f); if (g_Zoom != gZoomTarget) { float dz = g_DT * 1.7f; @@ -376,7 +359,7 @@ int root() if (!g_LastTouchDown) { g_PosPage = 0; } - return lastFrame(0); + return 0; } else { rsgClearColor(0.0f, 0.0f, 0.0f, g_Zoom); } @@ -403,7 +386,7 @@ int root() rsgBindProgramFragment(gPFTexNearest); draw_home_button(); - return lastFrame((g_PosVelocity != 0) || rsFrac(g_PosPage) || g_Zoom != gZoomTarget || (g_MoveToTime != 0)); + return (g_PosVelocity != 0) || rsFrac(g_PosPage) || g_Zoom != gZoomTarget || (g_MoveToTime != 0); } diff --git a/res/raw/allapps_bc.bc b/res/raw/allapps_bc.bc index 3835d7d748fc1c6b22a670f570cedae8ae77f950..59b0afbb20ada10d883b8eccc0a4b849eb9c7923 100644 GIT binary patch literal 11612 zcmb7q30PCd+VGt0kPs3!0|ZDQB3jU(hyhUpgcvH=pj1Iz5f|Me9+Fcttd0064iqa?VM6i#7H4k*QP7-PvaM^{o|yoMV_2q~q946-KMiD;Z~ z%gGXf%(9s8(L7JXaOAHQP+MEs@l}Q@amz3U@q}{#uz)Q+=WqCNGp^JQqZcB_n@3=g zf?0wO@Y@y;jOIr10GI;X$?mNdyydza;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p1eT$Q|4HU2X)qGOY+aoi$C)zz(s?M(`rZRBr$ARndVR7c>kk?{r3u4H;= zaRv6*6X9oNk@N75ae!Amen*So?~UW+Gwd7N;q5_IaeK7Vz#5@{JJbT^#FgeG=Ih!u zaH}=;@_)Z!_tloLU!S>Y-`VRy<$m_L`5ceJ6vRl&Tns!wISZdo)nP+RM(UKp+F~$CJEfRUts6Ivh}XC zTFL+Wk*MIL@84xirYS5kuGHq)m6v_-kt+T!vmH|y-5{`zZMVB2jWl3#+EiZy&ei*f z3OiX1i>!*C?tx;m&$5nr-J~Na^7kf>qWmJ*srHt=scKl{xxFx~@$bldTo~IEXP}(F*-AcR8*YeX$u4~zmH764 zKyy)jXWX+ZA^Q1|aq+G8QH{BQ5|>aJ1%K2pHJAl|7dVLp4jJvz9cDiY2Wd}M$DfSE zKdcQe{pIPEGd=PgEVMXzg?wCPLr@%7CHk3UF&mqrr+)IJ^9^?yO@_Hv$#AYiMbGWF zc?oza^um>PvmYwzu7=J|vUABR`F{PW|4~k3qJb@0fo#$*6j{_sI}-=!5~E|iPfEvC zvd;*l<9632Lgp*Q$()^W$!_z`4*dN7*qQgoXqlV0e*gIRmJ?QijZyK(yo6Bjlg@(1 OZ^rMinh!S}{QW;z(eI4_ diff --git a/src/com/android/launcher2/AllApps3D.java b/src/com/android/launcher2/AllApps3D.java index 85dd750ea7..4a2dc49e4e 100644 --- a/src/com/android/launcher2/AllApps3D.java +++ b/src/com/android/launcher2/AllApps3D.java @@ -268,19 +268,19 @@ public class AllApps3D extends RSSurfaceView } if (sRollo.mUniformAlloc != null) { - float tf[] = new float[] {120.f, 120.f, 0.f, 0.f, - (2.f / 480.f), 0, -((float)w / 2) - 0.25f, -380.25f, - 120.f, 680.f, - 72.f, 72.f,}; + ScriptField_VpConsts.Item i = new ScriptField_VpConsts.Item(); + i.ScaleOffset.x = (2.f / 480.f); + i.ScaleOffset.y = 0; + i.ScaleOffset.z = -((float)w / 2) - 0.25f; + i.ScaleOffset.w = -380.25f; + i.BendPos.x = 120.f; + i.BendPos.y = 680.f; if (w > h) { - tf[6] = 40.f; - tf[7] = h - 40.f; - tf[9] = 1.f; - tf[10] = -((float)w / 2) - 0.25f; - tf[11] = -((float)h / 2) - 0.25f; + i.ScaleOffset.z = 40.f; + i.ScaleOffset.w = h - 40.f; + i.BendPos.y = 1.f; } - - sRollo.mUniformAlloc.getAllocation().data(tf); + sRollo.mUniformAlloc.set(i, 0, true); } //long endTime = SystemClock.uptimeMillis(); @@ -601,9 +601,6 @@ public class AllApps3D extends RSSurfaceView mMotionDownRawX = (int)ev.getRawX(); mMotionDownRawY = (int)ev.getRawY(); - sRollo.mScript.set_gNewPositionX(ev.getRawY() / getHeight()); - sRollo.mScript.set_gNewTouchDown(1); - if (!sRollo.checkClickOK()) { sRollo.clearSelectedIcon(); } else { @@ -614,7 +611,7 @@ public class AllApps3D extends RSSurfaceView cancelLongPress(); } } - sRollo.move(); + sRollo.move(ev.getRawY() / getHeight()); mVelocityTracker = VelocityTracker.obtain(); mVelocityTracker.addMovement(ev); mStartedScrolling = false; @@ -647,9 +644,7 @@ public class AllApps3D extends RSSurfaceView cancelLongPress(); mCurrentIconIndex = -1; } - sRollo.mScript.set_gNewPositionX(ev.getRawY() / getHeight()); - sRollo.mScript.set_gNewTouchDown(1); - sRollo.move(); + sRollo.move(ev.getRawY() / getHeight()); mStartedScrolling = true; sRollo.clearSelectedIcon(); @@ -670,14 +665,10 @@ public class AllApps3D extends RSSurfaceView } mCurrentIconIndex = -1; } else if (mTouchTracking == TRACKING_FLING) { - sRollo.mScript.set_gNewTouchDown(0); - sRollo.mScript.set_gNewPositionX(ev.getRawY() / getHeight()); - mVelocityTracker.computeCurrentVelocity(1000 /* px/sec */, mMaxFlingVelocity); - sRollo.mScript.set_gFlingVelocity(mVelocityTracker.getYVelocity() / getHeight()); sRollo.clearSelectedIcon(); - sRollo.move(); - sRollo.fling(); + sRollo.fling(ev.getRawY() / getHeight(), + mVelocityTracker.getYVelocity() / getHeight()); if (mVelocityTracker != null) { mVelocityTracker.recycle(); @@ -923,17 +914,6 @@ public class AllApps3D extends RSSurfaceView return -1; } - /* - private static int countPages(int iconCount) { - int iconsPerPage = getColumnsCount() * Defines.ROWS_PER_PAGE_PORTRAIT; - int pages = iconCount / iconsPerPage; - if (pages*iconsPerPage != iconCount) { - pages++; - } - return pages; - } - */ - class AAMessage extends RenderScript.RSMessage { public void run() { sRollo.mScrollPos = ((float)mData[0]) / (1 << 16); @@ -967,12 +947,6 @@ public class AllApps3D extends RSSurfaceView private Resources mRes; ScriptC_Allapps mScript; - //private ProgramStore mPSIcons; - private ProgramFragment mPFTexMip; - private ProgramFragment mPFTexMipAlpha; - private ProgramFragment mPFTexNearest; - private ProgramVertex mPV; - private ProgramVertex mPVCurve; private SimpleMesh mMesh; private ProgramVertex.MatrixAllocation mPVA; @@ -989,7 +963,6 @@ public class AllApps3D extends RSSurfaceView private Allocation[] mLabels; private int[] mLabelIds; private Allocation mAllocLabelIds; - private Allocation mSelectedIcon; private Bitmap mSelectionBitmap; private Canvas mSelectionCanvas; @@ -1074,8 +1047,9 @@ public class AllApps3D extends RSSurfaceView ProgramVertex.Builder pvb = new ProgramVertex.Builder(sRS, null, null); pvb.setTextureMatrixEnable(true); - mPV = pvb.create(); - mPV.bindAllocation(mPVA); + ProgramVertex pv = pvb.create(); + pv.bindAllocation(mPVA); + sRS.contextBindProgramVertex(pv); mUniformAlloc = new ScriptField_VpConsts(sRS, 1); mScript.bind_vpConstants(mUniformAlloc); @@ -1141,12 +1115,11 @@ public class AllApps3D extends RSSurfaceView sb.setShader(t); sb.addConstant(mUniformAlloc.getType()); sb.addInput(mMesh.getVertexType(0).getElement()); - mPVCurve = sb.create(); - mPVCurve.bindAllocation(mPVA); - mPVCurve.bindConstants(mUniformAlloc.getAllocation(), 1); + ProgramVertex pvc = sb.create(); + pvc.bindAllocation(mPVA); + pvc.bindConstants(mUniformAlloc.getAllocation(), 1); - sRS.contextBindProgramVertex(mPV); - mScript.set_gPVCurve(mPVCurve); + mScript.set_gPVCurve(pvc); } private void initProgramFragment() { @@ -1164,20 +1137,20 @@ public class AllApps3D extends RSSurfaceView ProgramFragment.Builder bf = new ProgramFragment.Builder(sRS); bf.setTexture(ProgramFragment.Builder.EnvMode.MODULATE, ProgramFragment.Builder.Format.RGBA, 0); - mPFTexMip = bf.create(); - mPFTexMip.bindSampler(linear, 0); + ProgramFragment pfTexMip = bf.create(); + pfTexMip.bindSampler(linear, 0); - mPFTexNearest = bf.create(); - mPFTexNearest.bindSampler(nearest, 0); + ProgramFragment pfTexNearest = bf.create(); + pfTexNearest.bindSampler(nearest, 0); bf.setTexture(ProgramFragment.Builder.EnvMode.MODULATE, ProgramFragment.Builder.Format.ALPHA, 0); - mPFTexMipAlpha = bf.create(); - mPFTexMipAlpha.bindSampler(linear, 0); + ProgramFragment pfTexMipAlpha = bf.create(); + pfTexMipAlpha.bindSampler(linear, 0); - mScript.set_gPFTexNearest(mPFTexNearest); - mScript.set_gPFTexMip(mPFTexMip); - mScript.set_gPFTexMipAlpha(mPFTexMipAlpha); + mScript.set_gPFTexNearest(pfTexNearest); + mScript.set_gPFTexMip(pfTexMip); + mScript.set_gPFTexMipAlpha(pfTexMipAlpha); } private void initProgramStore() { @@ -1258,14 +1231,7 @@ public class AllApps3D extends RSSurfaceView sRollo.clearSelectedIcon(); sRollo.setHomeSelected(SELECTED_NONE); } - if (zoom > 0.001f) { - sRollo.mScript.set_gZoomTarget(zoom); - } else { - sRollo.mScript.set_gZoomTarget(0); - } - if (!animate) { - sRollo.mScript.invoke_setZoom(); - } + sRollo.mScript.invoke_setZoom(zoom, animate ? 1 : 0); } private void createAppIconAllocations(int index, ApplicationInfo item) { @@ -1367,17 +1333,16 @@ public class AllApps3D extends RSSurfaceView } } - void fling() { - mScript.invoke_fling(); + void fling(float pos, float v) { + mScript.invoke_fling(pos, v); } - void move() { - mScript.invoke_move(); + void move(float pos) { + mScript.invoke_move(pos); } void moveTo(float row) { - mScript.set_gTargetPos(row); - mScript.invoke_moveTo(); + mScript.invoke_moveTo(row); } /** @@ -1426,10 +1391,10 @@ public class AllApps3D extends RSSurfaceView selectionBitmap.getWidth(), selectionBitmap.getHeight(), pressed == SELECTED_PRESSED, info.iconBitmap); - mSelectedIcon = Allocation.createFromBitmap(sRS, selectionBitmap, + Allocation si = Allocation.createFromBitmap(sRS, selectionBitmap, Element.RGBA_8888(sRS), false); - mSelectedIcon.uploadToTexture(0); - mScript.set_gSelectedIconTexture(mSelectedIcon); + si.uploadToTexture(0); + mScript.set_gSelectedIconTexture(si); if (prev != index) { if (info.title != null && info.title.length() > 0) { diff --git a/src/com/android/launcher2/ScriptC_Allapps.java b/src/com/android/launcher2/ScriptC_Allapps.java index 55e3df06ed..aeb1c26503 100644 --- a/src/com/android/launcher2/ScriptC_Allapps.java +++ b/src/com/android/launcher2/ScriptC_Allapps.java @@ -70,40 +70,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_ROWS_PER_PAGE_LANDSCAPE; } - private final static int mExportVarIdx_gNewPositionX = 4; - private float mExportVar_gNewPositionX; - public void set_gNewPositionX(float v) { - mExportVar_gNewPositionX = v; - setVar(mExportVarIdx_gNewPositionX, v); - } - - public float get_gNewPositionX() { - return mExportVar_gNewPositionX; - } - - private final static int mExportVarIdx_gNewTouchDown = 5; - private int mExportVar_gNewTouchDown; - public void set_gNewTouchDown(int v) { - mExportVar_gNewTouchDown = v; - setVar(mExportVarIdx_gNewTouchDown, v); - } - - public int get_gNewTouchDown() { - return mExportVar_gNewTouchDown; - } - - private final static int mExportVarIdx_gFlingVelocity = 6; - private float mExportVar_gFlingVelocity; - public void set_gFlingVelocity(float v) { - mExportVar_gFlingVelocity = v; - setVar(mExportVarIdx_gFlingVelocity, v); - } - - public float get_gFlingVelocity() { - return mExportVar_gFlingVelocity; - } - - private final static int mExportVarIdx_gIconCount = 7; + private final static int mExportVarIdx_gIconCount = 4; private int mExportVar_gIconCount; public void set_gIconCount(int v) { mExportVar_gIconCount = v; @@ -114,7 +81,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gIconCount; } - private final static int mExportVarIdx_gSelectedIconIndex = 8; + private final static int mExportVarIdx_gSelectedIconIndex = 5; private int mExportVar_gSelectedIconIndex; public void set_gSelectedIconIndex(int v) { mExportVar_gSelectedIconIndex = v; @@ -125,7 +92,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gSelectedIconIndex; } - private final static int mExportVarIdx_gSelectedIconTexture = 9; + private final static int mExportVarIdx_gSelectedIconTexture = 6; private Allocation mExportVar_gSelectedIconTexture; public void set_gSelectedIconTexture(Allocation v) { mExportVar_gSelectedIconTexture = v; @@ -136,18 +103,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gSelectedIconTexture; } - private final static int mExportVarIdx_gZoomTarget = 10; - private float mExportVar_gZoomTarget; - public void set_gZoomTarget(float v) { - mExportVar_gZoomTarget = v; - setVar(mExportVarIdx_gZoomTarget, v); - } - - public float get_gZoomTarget() { - return mExportVar_gZoomTarget; - } - - private final static int mExportVarIdx_gHomeButton = 11; + private final static int mExportVarIdx_gHomeButton = 7; private Allocation mExportVar_gHomeButton; public void set_gHomeButton(Allocation v) { mExportVar_gHomeButton = v; @@ -158,18 +114,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gHomeButton; } - private final static int mExportVarIdx_gTargetPos = 12; - private float mExportVar_gTargetPos; - public void set_gTargetPos(float v) { - mExportVar_gTargetPos = v; - setVar(mExportVarIdx_gTargetPos, v); - } - - public float get_gTargetPos() { - return mExportVar_gTargetPos; - } - - private final static int mExportVarIdx_gPFTexNearest = 13; + private final static int mExportVarIdx_gPFTexNearest = 8; private ProgramFragment mExportVar_gPFTexNearest; public void set_gPFTexNearest(ProgramFragment v) { mExportVar_gPFTexNearest = v; @@ -180,7 +125,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gPFTexNearest; } - private final static int mExportVarIdx_gPFTexMip = 14; + private final static int mExportVarIdx_gPFTexMip = 9; private ProgramFragment mExportVar_gPFTexMip; public void set_gPFTexMip(ProgramFragment v) { mExportVar_gPFTexMip = v; @@ -191,7 +136,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gPFTexMip; } - private final static int mExportVarIdx_gPFTexMipAlpha = 15; + private final static int mExportVarIdx_gPFTexMipAlpha = 10; private ProgramFragment mExportVar_gPFTexMipAlpha; public void set_gPFTexMipAlpha(ProgramFragment v) { mExportVar_gPFTexMipAlpha = v; @@ -202,7 +147,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gPFTexMipAlpha; } - private final static int mExportVarIdx_gPVCurve = 16; + private final static int mExportVarIdx_gPVCurve = 11; private ProgramVertex mExportVar_gPVCurve; public void set_gPVCurve(ProgramVertex v) { mExportVar_gPVCurve = v; @@ -213,7 +158,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gPVCurve; } - private final static int mExportVarIdx_gPS = 17; + private final static int mExportVarIdx_gPS = 12; private ProgramStore mExportVar_gPS; public void set_gPS(ProgramStore v) { mExportVar_gPS = v; @@ -224,7 +169,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gPS; } - private final static int mExportVarIdx_gSMCell = 18; + private final static int mExportVarIdx_gSMCell = 13; private SimpleMesh mExportVar_gSMCell; public void set_gSMCell(SimpleMesh v) { mExportVar_gSMCell = v; @@ -235,7 +180,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gSMCell; } - private final static int mExportVarIdx_gIconIDs = 19; + private final static int mExportVarIdx_gIconIDs = 14; private Allocation mExportVar_gIconIDs; public void bind_gIconIDs(Allocation v) { mExportVar_gIconIDs = v; @@ -247,7 +192,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gIconIDs; } - private final static int mExportVarIdx_gLabelIDs = 20; + private final static int mExportVarIdx_gLabelIDs = 15; private Allocation mExportVar_gLabelIDs; public void bind_gLabelIDs(Allocation v) { mExportVar_gLabelIDs = v; @@ -259,7 +204,7 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_gLabelIDs; } - private final static int mExportVarIdx_vpConstants = 21; + private final static int mExportVarIdx_vpConstants = 16; private ScriptField_VpConsts mExportVar_vpConstants; public void bind_vpConstants(ScriptField_VpConsts v) { mExportVar_vpConstants = v; @@ -271,29 +216,45 @@ public class ScriptC_Allapps extends ScriptC { return mExportVar_vpConstants; } - private final static int mExportFuncIdx_resetHWWar = 0; - public void invoke_resetHWWar() { - invoke(mExportFuncIdx_resetHWWar); + private final static int mExportVarIdx_gTargetPos = 17; + private float mExportVar_gTargetPos; + public void set_gTargetPos(float v) { + mExportVar_gTargetPos = v; + setVar(mExportVarIdx_gTargetPos, v); } - private final static int mExportFuncIdx_move = 1; - public void invoke_move() { - invoke(mExportFuncIdx_move); + public float get_gTargetPos() { + return mExportVar_gTargetPos; } - private final static int mExportFuncIdx_moveTo = 2; - public void invoke_moveTo() { - invoke(mExportFuncIdx_moveTo); + private final static int mExportFuncIdx_move = 0; + public void invoke_move(float newPos) { + FieldPacker move_fp = new FieldPacker(4); + move_fp.addF32(newPos); + invoke(mExportFuncIdx_move, move_fp); } - private final static int mExportFuncIdx_setZoom = 3; - public void invoke_setZoom() { - invoke(mExportFuncIdx_setZoom); + private final static int mExportFuncIdx_moveTo = 1; + public void invoke_moveTo(float targetPos) { + FieldPacker moveTo_fp = new FieldPacker(4); + moveTo_fp.addF32(targetPos); + invoke(mExportFuncIdx_moveTo, moveTo_fp); } - private final static int mExportFuncIdx_fling = 4; - public void invoke_fling() { - invoke(mExportFuncIdx_fling); + private final static int mExportFuncIdx_setZoom = 2; + public void invoke_setZoom(float z, int animate) { + FieldPacker setZoom_fp = new FieldPacker(8); + setZoom_fp.addF32(z); + setZoom_fp.addI32(animate); + invoke(mExportFuncIdx_setZoom, setZoom_fp); + } + + private final static int mExportFuncIdx_fling = 3; + public void invoke_fling(float newPos, float vel) { + FieldPacker fling_fp = new FieldPacker(8); + fling_fp.addF32(newPos); + fling_fp.addF32(vel); + invoke(mExportFuncIdx_fling, fling_fp); } } diff --git a/src/com/android/launcher2/ScriptField_VpConsts.java b/src/com/android/launcher2/ScriptField_VpConsts.java index f3ef68413a..b5e41b7808 100644 --- a/src/com/android/launcher2/ScriptField_VpConsts.java +++ b/src/com/android/launcher2/ScriptField_VpConsts.java @@ -69,7 +69,7 @@ public class ScriptField_VpConsts extends android.renderscript.Script.FieldBase mItemArray[index] = i; if (copyNow) { copyToArray(i, index); - mAllocation.subData1D(index * Item.sizeof, Item.sizeof, mIOBuffer.getData()); + mAllocation.subData1D(index /** Item.sizeof*/, 1/*Item.sizeof*/, mIOBuffer.getData()); } }