diff options
author | 2017-05-08 21:31:02 +0000 | |
---|---|---|
committer | 2017-05-08 21:31:02 +0000 | |
commit | 380983107b19cf4cd068441d8c9f5fec2c72a012 (patch) | |
tree | 38b9f5b686c0bdf1722a372491f496dc841b9289 | |
parent | 77ca79bb2aae6cc546c75621d969c4c94ed8156a (diff) | |
parent | 939ba3591357e924530c7571a84702cf6624397e (diff) |
Merge "Merge "Fix a NPE with outlineProvider="none"" am: 46a4fbb2e4 am: 65d65ec14b am: a3460f2bb1" into oc-dev-plus-aosp
am: 939ba35913
Change-Id: Ib427f57b4a505b1622758773f24c44e1bd69db6d
-rw-r--r-- | tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java b/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java index 23caaf85eb8e..4b760a7d4638 100644 --- a/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java +++ b/tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java @@ -50,12 +50,14 @@ public class ViewGroup_Delegate { // the outline obtained is correct. child.setBackgroundBounds(); ViewOutlineProvider outlineProvider = child.getOutlineProvider(); - Outline outline = child.mAttachInfo.mTmpOutline; - 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); - canvas.restoreToCount(restoreTo); + if (outlineProvider != null) { + Outline outline = child.mAttachInfo.mTmpOutline; + 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); + canvas.restoreToCount(restoreTo); + } } } return thisVG.drawChild_Original(canvas, child, drawingTime); |