Simplifying logic to create/destroy hardware layers in All Apps
Bug # 3422984
This commit is contained in:
parent
aefd4e1f51
commit
c5e49022be
|
@ -515,6 +515,7 @@ public class AllAppsPagedView extends PagedViewWithDraggableItems implements All
|
|||
layout.addViewToCellLayout(icon, -1, 0,
|
||||
new PagedViewCellLayout.LayoutParams(0, 0, 4, 1));
|
||||
}
|
||||
layout.createHardwareLayers();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -597,21 +597,7 @@ public abstract class PagedView extends ViewGroup {
|
|||
canvas.clipRect(mScrollX, mScrollY, mScrollX + mRight - mLeft,
|
||||
mScrollY + mBottom - mTop);
|
||||
|
||||
for (int i = 0; i < pageCount; i++) {
|
||||
View child = getChildAt(i);
|
||||
if (child != null && child instanceof PagedViewCellLayout) {
|
||||
boolean willBeDrawn = i >= leftScreen && i <= rightScreen;
|
||||
if (!willBeDrawn) {
|
||||
((PagedViewCellLayout)child).destroyHardwareLayers();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = leftScreen; i <= rightScreen; i++) {
|
||||
View child = getChildAt(i);
|
||||
if (child != null && child instanceof PagedViewCellLayout) {
|
||||
((PagedViewCellLayout)child).createHardwareLayers();
|
||||
}
|
||||
drawChild(canvas, getChildAt(i), drawingTime);
|
||||
}
|
||||
canvas.restore();
|
||||
|
|
|
@ -141,6 +141,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
|
|||
public void removeAllViewsOnPage() {
|
||||
mChildren.removeAllViews();
|
||||
mHolographicChildren.removeAllViews();
|
||||
destroyHardwareLayers();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue