am 37cdc191: Merge "Don\'t invalidate() on setClipBounds" into lmp-mr1-dev
* commit '37cdc191e380cca8edcc58f116b9b319bea1c140': Don't invalidate() on setClipBounds
This commit is contained in:
@@ -14768,27 +14768,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
* this view, to which future drawing operations will be clipped.
|
* this view, to which future drawing operations will be clipped.
|
||||||
*/
|
*/
|
||||||
public void setClipBounds(Rect clipBounds) {
|
public void setClipBounds(Rect clipBounds) {
|
||||||
|
if (clipBounds == mClipBounds
|
||||||
|
|| (clipBounds != null && clipBounds.equals(mClipBounds))) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (clipBounds != null) {
|
if (clipBounds != null) {
|
||||||
if (clipBounds.equals(mClipBounds)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (mClipBounds == null) {
|
if (mClipBounds == null) {
|
||||||
invalidate();
|
|
||||||
mClipBounds = new Rect(clipBounds);
|
mClipBounds = new Rect(clipBounds);
|
||||||
} else {
|
} else {
|
||||||
invalidate(Math.min(mClipBounds.left, clipBounds.left),
|
|
||||||
Math.min(mClipBounds.top, clipBounds.top),
|
|
||||||
Math.max(mClipBounds.right, clipBounds.right),
|
|
||||||
Math.max(mClipBounds.bottom, clipBounds.bottom));
|
|
||||||
mClipBounds.set(clipBounds);
|
mClipBounds.set(clipBounds);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (mClipBounds != null) {
|
mClipBounds = null;
|
||||||
invalidate();
|
|
||||||
mClipBounds = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mRenderNode.setClipBounds(mClipBounds);
|
mRenderNode.setClipBounds(mClipBounds);
|
||||||
|
invalidateViewProperty(false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user