Merge "Skip drawing offscreen objects" into jb-mr1-dev

This commit is contained in:
Chet Haase
2012-10-17 12:36:23 -07:00
committed by Android (Google) Code Review

View File

@@ -887,11 +887,12 @@ public final class ViewRootImpl implements ViewParent,
// Intersect with the bounds of the window to skip
// updates that lie outside of the visible region
final float appScale = mAttachInfo.mApplicationScale;
localDirty.intersect(0, 0,
(int) (mWidth * appScale + 0.5f), (int) (mHeight * appScale + 0.5f));
if (!mWillDrawSoon) {
if (localDirty.intersect(0, 0,
(int) (mWidth * appScale + 0.5f), (int) (mHeight * appScale + 0.5f)) &&
!mWillDrawSoon) {
scheduleTraversals();
} else {
localDirty.setEmpty();
}
return null;