diff options
author | Diego Perez <diegoperez@google.com> | 2015-02-17 22:19:43 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-02-17 22:19:43 +0000 |
commit | a0fb87a3b831e8eb4e4f7e03fc170cf8f93a2161 (patch) | |
tree | cd7dcf2d36e3969b2b76f0d37d7261bbec6204d6 /tools | |
parent | 221d732005b04b5f979d2e03e8ebe00160e52ca3 (diff) | |
parent | a912fedbc5fba99fb75884a1941d58170822ceb4 (diff) | |
download | frameworks_base-a0fb87a3b831e8eb4e4f7e03fc170cf8f93a2161.zip frameworks_base-a0fb87a3b831e8eb4e4f7e03fc170cf8f93a2161.tar.gz frameworks_base-a0fb87a3b831e8eb4e4f7e03fc170cf8f93a2161.tar.bz2 |
am 98c3461a: Merge "Do not paint shadow if outside of the clip area" into lmp-dev
automerge: a912fed
* commit 'a912fedbc5fba99fb75884a1941d58170822ceb4':
Do not paint shadow if outside of the clip area
Diffstat (limited to 'tools')
-rw-r--r-- | tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java b/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java index a6c00f7..3915046 100644 --- a/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java +++ b/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java @@ -71,8 +71,10 @@ public class ViewGroup_Delegate { int x = 0; if (outline.mRect != null) { Shadow s = getRectShadow(parent, canvas, child, outline); - shadow = s.mShadow; - x = -s.mShadowWidth; + if (s != null) { + shadow = s.mShadow; + x = -s.mShadowWidth; + } } else if (outline.mPath != null) { shadow = getPathShadow(child, outline, canvas); } @@ -132,6 +134,9 @@ public class ViewGroup_Delegate { private static BufferedImage getPathShadow(View child, Outline outline, Canvas canvas) { Rect clipBounds = canvas.getClipBounds(); + if (clipBounds.isEmpty()) { + return null; + } BufferedImage image = new BufferedImage(clipBounds.width(), clipBounds.height(), BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = image.createGraphics(); |