Merge "Launcher performance optimizations: shaving about 3ms off Workspace.dispatchDraw()" into ics-mr1
This commit is contained in:
@@ -1120,10 +1120,16 @@ public class Workspace extends SmoothPagedView
|
||||
backgroundAlphaInterpolator(Math.abs(scrollProgress)));
|
||||
}
|
||||
}
|
||||
cl.setTranslationX(translationX);
|
||||
cl.setRotationY(rotation);
|
||||
cl.setFastTranslationX(translationX);
|
||||
cl.setFastRotationY(rotation);
|
||||
if (mFadeInAdjacentScreens && !isSmall()) {
|
||||
float alpha = 1 - Math.abs(scrollProgress);
|
||||
cl.setFastAlpha(alpha);
|
||||
}
|
||||
cl.fastInvalidate();
|
||||
}
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
|
||||
private void resetCellLayoutTransforms(CellLayout cl, boolean left) {
|
||||
@@ -1157,10 +1163,12 @@ public class Workspace extends SmoothPagedView
|
||||
|
||||
@Override
|
||||
protected void screenScrolled(int screenCenter) {
|
||||
super.screenScrolled(screenCenter);
|
||||
if (LauncherApplication.isScreenLarge()) {
|
||||
// We don't call super.screenScrolled() here because we handle the adjacent pages alpha
|
||||
// ourselves (for efficiency), and there are no scrolling indicators to update.
|
||||
screenScrolledLargeUI(screenCenter);
|
||||
} else {
|
||||
super.screenScrolled(screenCenter);
|
||||
screenScrolledStandardUI(screenCenter);
|
||||
}
|
||||
}
|
||||
@@ -1348,13 +1356,6 @@ public class Workspace extends SmoothPagedView
|
||||
position[0], position[1], 0, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateAdjacentPagesAlpha() {
|
||||
if (!isSmall()) {
|
||||
super.updateAdjacentPagesAlpha();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This interpolator emulates the rate at which the perceived scale of an object changes
|
||||
* as its distance from a camera increases. When this interpolator is applied to a scale
|
||||
@@ -1517,7 +1518,6 @@ public class Workspace extends SmoothPagedView
|
||||
|
||||
final State oldState = mState;
|
||||
final boolean oldStateIsNormal = (oldState == State.NORMAL);
|
||||
final boolean oldStateIsSpringLoaded = (oldState == State.SPRING_LOADED);
|
||||
final boolean oldStateIsSmall = (oldState == State.SMALL);
|
||||
mState = state;
|
||||
final boolean stateIsNormal = (state == State.NORMAL);
|
||||
|
||||
Reference in New Issue
Block a user