Loading core/java/android/view/View.java +14 −5 Original line number Diff line number Diff line Loading @@ -15778,11 +15778,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return; } if (mBackgroundSizeChanged) { background.setBounds(0, 0, mRight - mLeft, mBottom - mTop); mBackgroundSizeChanged = false; rebuildOutline(); } setBackgroundBounds(); // Attempt to use a display list if requested. if (canvas.isHardwareAccelerated() && mAttachInfo != null Loading @@ -15808,6 +15804,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * Sets the correct background bounds and rebuilds the outline, if needed. * <p/> * This is called by LayoutLib. */ void setBackgroundBounds() { if (mBackgroundSizeChanged && mBackground != null) { mBackground.setBounds(0, 0, mRight - mLeft, mBottom - mTop); mBackgroundSizeChanged = false; rebuildOutline(); } } private void setBackgroundRenderNodeProperties(RenderNode renderNode) { renderNode.setTranslationX(mScrollX); renderNode.setTranslationY(mScrollY); tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +5 −2 Original line number Diff line number Diff line Loading @@ -220,7 +220,8 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restore(long nativeCanvas) { /*package*/ static void native_restore(long nativeCanvas, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -231,7 +232,9 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restoreToCount(long nativeCanvas, int saveCount) { /*package*/ static void native_restoreToCount(long nativeCanvas, int saveCount, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java +4 −8 Original line number Diff line number Diff line Loading @@ -46,16 +46,12 @@ public class ViewGroup_Delegate { /*package*/ static boolean drawChild(ViewGroup thisVG, Canvas canvas, View child, long drawingTime) { if (child.getZ() > thisVG.getZ()) { // The background's bounds are set lazily. Make sure they are set correctly so that // the outline obtained is correct. child.setBackgroundBounds(); ViewOutlineProvider outlineProvider = child.getOutlineProvider(); Outline outline = new Outline(); Outline outline = child.mAttachInfo.mTmpOutline; outlineProvider.getOutline(child, outline); if (outline.mPath == null && outline.mRect == null) { // Sometimes, the bounds of the background drawable are not set until View.draw() // is called. So, we set the bounds manually and try to get the outline again. child.getBackground().setBounds(0, 0, child.mRight - child.mLeft, child.mBottom - child.mTop); outlineProvider.getOutline(child, outline); } if (outline.mPath != null || (outline.mRect != null && !outline.mRect.isEmpty())) { int restoreTo = transformCanvas(thisVG, canvas, child); drawShadow(thisVG, canvas, child, outline); Loading Loading
core/java/android/view/View.java +14 −5 Original line number Diff line number Diff line Loading @@ -15778,11 +15778,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return; } if (mBackgroundSizeChanged) { background.setBounds(0, 0, mRight - mLeft, mBottom - mTop); mBackgroundSizeChanged = false; rebuildOutline(); } setBackgroundBounds(); // Attempt to use a display list if requested. if (canvas.isHardwareAccelerated() && mAttachInfo != null Loading @@ -15808,6 +15804,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } /** * Sets the correct background bounds and rebuilds the outline, if needed. * <p/> * This is called by LayoutLib. */ void setBackgroundBounds() { if (mBackgroundSizeChanged && mBackground != null) { mBackground.setBounds(0, 0, mRight - mLeft, mBottom - mTop); mBackgroundSizeChanged = false; rebuildOutline(); } } private void setBackgroundRenderNodeProperties(RenderNode renderNode) { renderNode.setTranslationX(mScrollX); renderNode.setTranslationY(mScrollY);
tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +5 −2 Original line number Diff line number Diff line Loading @@ -220,7 +220,8 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restore(long nativeCanvas) { /*package*/ static void native_restore(long nativeCanvas, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading @@ -231,7 +232,9 @@ public final class Canvas_Delegate { } @LayoutlibDelegate /*package*/ static void native_restoreToCount(long nativeCanvas, int saveCount) { /*package*/ static void native_restoreToCount(long nativeCanvas, int saveCount, boolean throwOnUnderflow) { // FIXME: implement throwOnUnderflow. // get the delegate from the native int. Canvas_Delegate canvasDelegate = sManager.getDelegate(nativeCanvas); if (canvasDelegate == null) { Loading
tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java +4 −8 Original line number Diff line number Diff line Loading @@ -46,16 +46,12 @@ public class ViewGroup_Delegate { /*package*/ static boolean drawChild(ViewGroup thisVG, Canvas canvas, View child, long drawingTime) { if (child.getZ() > thisVG.getZ()) { // The background's bounds are set lazily. Make sure they are set correctly so that // the outline obtained is correct. child.setBackgroundBounds(); ViewOutlineProvider outlineProvider = child.getOutlineProvider(); Outline outline = new Outline(); Outline outline = child.mAttachInfo.mTmpOutline; outlineProvider.getOutline(child, outline); if (outline.mPath == null && outline.mRect == null) { // Sometimes, the bounds of the background drawable are not set until View.draw() // is called. So, we set the bounds manually and try to get the outline again. child.getBackground().setBounds(0, 0, child.mRight - child.mLeft, child.mBottom - child.mTop); outlineProvider.getOutline(child, outline); } if (outline.mPath != null || (outline.mRect != null && !outline.mRect.isEmpty())) { int restoreTo = transformCanvas(thisVG, canvas, child); drawShadow(thisVG, canvas, child, outline); Loading