Disable hardware layer on custom screen

Whereas standard ShortcutAndWidgetContainers are static during screen
transition, the custom screen may animate during its transition.
Disabling the hardware layer reduces the cost of this animation
significantly.

bug:10810505

Change-Id: I560d209f651951f54c224862a706e8a243dc71af
This commit is contained in:
Chris Craik committed 2013-10-01 15:07:17 -07:00
1 parent 9cfd586305
commit 01f2d7fa4b
2 files changed
+12 -17

No files matched your search

+10 -11
View File
@@ -1046,7 +1046,7 @@ public class Workspace extends SmoothPagedView
mLauncher.updateVoiceButtonProxyVisible(false);
}
}
};
}
protected void setWallpaperDimension() {
String spKey = WallpaperCropActivity.getSharedPreferencesKey();
@@ -1572,7 +1572,7 @@ public class Workspace extends SmoothPagedView
} else {
for (int i = 0; i < getPageCount(); i++) {
final CellLayout cl = (CellLayout) getChildAt(i);
cl.disableHardwareLayers();
cl.enableHardwareLayer(false);
}
}
}
@@ -1592,17 +1592,16 @@ public class Workspace extends SmoothPagedView
leftScreen--;
}
}
final CellLayout customScreen = mWorkspaceScreens.get(CUSTOM_CONTENT_SCREEN_ID);
for (int i = 0; i < screenCount; i++) {
final CellLayout layout = (CellLayout) getPageAt(i);
if (!(leftScreen <= i && i <= rightScreen && shouldDrawChild(layout))) {
layout.disableHardwareLayers();
}
}
for (int i = 0; i < screenCount; i++) {
final CellLayout layout = (CellLayout) getPageAt(i);
if (leftScreen <= i && i <= rightScreen && shouldDrawChild(layout)) {
layout.enableHardwareLayers();
}
// enable layers between left and right screen inclusive, except for the
// customScreen, which may animate its content during transitions.
boolean enableLayer = layout != customScreen &&
leftScreen <= i && i <= rightScreen && shouldDrawChild(layout);
layout.enableHardwareLayer(enableLayer);
}
}
}