diff options
author | Romain Guy <> | 2009-03-27 15:40:27 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-27 15:40:27 -0700 |
commit | d9b7d24667f578ec7aaf187690d5b12d6f363221 (patch) | |
tree | 99ce3e7b4da1107c6e7f8b6b0f5e35840fa94290 /core | |
parent | 059c446fbffd88802b051b846ce09e6a403c99aa (diff) | |
download | frameworks_base-d9b7d24667f578ec7aaf187690d5b12d6f363221.zip frameworks_base-d9b7d24667f578ec7aaf187690d5b12d6f363221.tar.gz frameworks_base-d9b7d24667f578ec7aaf187690d5b12d6f363221.tar.bz2 |
AI 143249: am: CL 142820 am: CL 142818 Fixes #1735278. Deep hierarchies could generate stack overflow exception due to new local variables introduces in Cupcake. This change removes 4 ints from the dispatchDraw/drawChild code path to save a bit of stack on deep hierarchies. This is a stop-gap measure but that's all we can/should do for now.
Original author: romainguy
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...
Automated import of CL 143249
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/view/ViewGroup.java | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 4f506ff..e686d1c 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -1208,11 +1208,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final boolean clipToPadding = (flags & CLIP_TO_PADDING_MASK) == CLIP_TO_PADDING_MASK; if (clipToPadding) { saveCount = canvas.save(); - final int scrollX = mScrollX; - final int scrollY = mScrollY; - canvas.clipRect(scrollX + mPaddingLeft, scrollY + mPaddingTop, - scrollX + mRight - mLeft - mPaddingRight, - scrollY + mBottom - mTop - mPaddingBottom); + canvas.clipRect(mScrollX + mPaddingLeft, mScrollY + mPaddingTop, + mScrollX + mRight - mLeft - mPaddingRight, + mScrollY + mBottom - mTop - mPaddingBottom); } @@ -1346,9 +1344,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final Animation a = child.getAnimation(); boolean concatMatrix = false; - final int childWidth = cr - cl; - final int childHeight = cb - ct; - if (a != null) { if (mInvalidateRegion == null) { mInvalidateRegion = new RectF(); @@ -1357,8 +1352,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final boolean initialized = a.isInitialized(); if (!initialized) { - a.initialize(childWidth, childHeight, getWidth(), getHeight()); - a.initializeInvalidateRegion(0, 0, childWidth, childHeight); + a.initialize(cr - cl, cb - ct, getWidth(), getHeight()); + a.initializeInvalidateRegion(0, 0, cr - cl, cb - ct); child.onAnimationStart(); } @@ -1382,7 +1377,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager invalidate(cl, ct, cr, cb); } } else { - a.getInvalidateRegion(0, 0, childWidth, childHeight, region, transformToApply); + a.getInvalidateRegion(0, 0, cr - cl, cb - ct, region, transformToApply); // The child need to draw an animation, potentially offscreen, so // make sure we do not cancel invalidate requests @@ -1474,9 +1469,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if ((flags & FLAG_CLIP_CHILDREN) == FLAG_CLIP_CHILDREN) { if (hasNoCache) { - canvas.clipRect(sx, sy, sx + childWidth, sy + childHeight); + canvas.clipRect(sx, sy, sx + (cr - cl), sy + (cb - ct)); } else { - canvas.clipRect(0, 0, childWidth, childHeight); + canvas.clipRect(0, 0, cr - cl, cb - ct); } } |