Merge "Fix incorrect dirty rectangle transformation in hardware layers. Bug #3413433" into honeycomb

This commit is contained in:
Romain Guy
2011-02-02 00:47:21 -08:00
committed by Android (Google) Code Review
2 changed files with 8 additions and 7 deletions

View File

@@ -3537,6 +3537,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
// Make sure we do not set both flags at the same time
int opaqueFlag = isOpaque ? DIRTY_OPAQUE : DIRTY;
if (child.mLayerType != LAYER_TYPE_NONE) {
mPrivateFlags |= INVALIDATED;
mPrivateFlags &= ~DRAWING_CACHE_VALID;
child.mLocalDirtyRect.union(dirty);
}
final int[] location = attachInfo.mInvalidateChildLocation;
location[CHILD_LEFT_INDEX] = child.mLeft;
location[CHILD_TOP_INDEX] = child.mTop;
@@ -3550,12 +3556,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
(int) (boundingRect.bottom + 0.5f));
}
if (child.mLayerType != LAYER_TYPE_NONE) {
mPrivateFlags |= INVALIDATED;
mPrivateFlags &= ~DRAWING_CACHE_VALID;
child.mLocalDirtyRect.union(dirty);
}
do {
View view = null;
if (parent instanceof View) {
@@ -3639,7 +3639,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
if (mLayerType != LAYER_TYPE_NONE) {
mLocalDirtyRect.union(dirty);
}
return mParent;
}
} else {

View File

@@ -39,6 +39,7 @@ void LayerRenderer::prepareDirty(float left, float top, float right, float botto
mLayer->region.clear();
dirty.set(0.0f, 0.0f, mLayer->width, mLayer->height);
} else {
dirty.intersect(0.0f, 0.0f, mLayer->width, mLayer->height);
android::Rect r(dirty.left, dirty.top, dirty.right, dirty.bottom);
mLayer->region.subtractSelf(r);
}