Remove use of private api ViewGroup.setChildrenLayersEnabled

Change-Id: I877bd84c6846ae232e2877e97de95d9344c13e56
This commit is contained in:
Michael Jurka
2012-06-21 09:38:41 -07:00
parent 915500da48
commit 3a0469d1e4
2 changed files with 27 additions and 30 deletions
-9
View File
@@ -790,20 +790,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
canvas.clipRect(getScrollX(), getScrollY(), getScrollX() + getRight() - getLeft(),
getScrollY() + getBottom() - getTop());
// On certain graphics drivers, if you draw to a off-screen buffer that's not
// used, it can lead to poor performance. We were running into this when
// setChildrenLayersEnabled was called on a CellLayout; that triggered a re-draw
// of that CellLayout's hardware layer, even if that CellLayout wasn't visible.
// As a fix, below we set pages that aren't going to be rendered are to be
// View.INVISIBLE, preventing re-drawing of their hardware layer
for (int i = getChildCount() - 1; i >= 0; i--) {
final View v = getPageAt(i);
if (mForceDrawAllChildrenNextFrame ||
(leftScreen <= i && i <= rightScreen && shouldDrawChild(v))) {
v.setVisibility(VISIBLE);
drawChild(canvas, v, drawingTime);
} else {
v.setVisibility(INVISIBLE);
}
}
mForceDrawAllChildrenNextFrame = false;