Remove use of private api ViewGroup.setChildrenLayersEnabled
Change-Id: I877bd84c6846ae232e2877e97de95d9344c13e56
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user