summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-10-17 12:36:23 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-17 12:36:24 -0700
commitd95316e2c78c7e6cfacac9cced66f7ace36d6497 (patch)
tree5a40023e55a9dcf909e44108568a176eb08d9e35
parent16627347ef5c22914ccb69ff7b7035c9c9d7ab07 (diff)
parentb78ee0ef60e5323b15b4ffdc97be4d889e272b79 (diff)
downloadframeworks_base-d95316e2c78c7e6cfacac9cced66f7ace36d6497.zip
frameworks_base-d95316e2c78c7e6cfacac9cced66f7ace36d6497.tar.gz
frameworks_base-d95316e2c78c7e6cfacac9cced66f7ace36d6497.tar.bz2
Merge "Skip drawing offscreen objects" into jb-mr1-dev
-rw-r--r--core/java/android/view/ViewRootImpl.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7ce3042..b5a9090 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -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;