Fix setLayerType

Bug: 15682142

 mLayerType/getLayerType() can modify the display list, so invalidate()
 is necessary

Change-Id: I1d323c1bd4356b31159b51d4299de099e53a0389
This commit is contained in:
John Reck
2014-06-17 14:23:31 -07:00
parent 2995606963
commit ca0608af3c

View File

@@ -13432,8 +13432,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// Destroy any previous software drawing cache if needed
if (mLayerType == LAYER_TYPE_SOFTWARE) {
destroyDrawingCache();
invalidateParentCaches();
invalidate(true);
}
mLayerType = layerType;
@@ -13441,13 +13439,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
mLayerPaint = layerDisabled ? null : (paint == null ? new Paint() : paint);
mRenderNode.setLayerPaint(mLayerPaint);
if (mLayerType == LAYER_TYPE_SOFTWARE) {
// LAYER_TYPE_SOFTWARE is handled by View:draw(), so need to invalidate()
invalidateParentCaches();
invalidate(true);
} else {
invalidateViewProperty(false, false);
}
// draw() behaves differently if we are on a layer, so we need to
// invalidate() here
invalidateParentCaches();
invalidate(true);
}
/**