diff options
author | 2017-05-08 21:20:38 +0000 | |
---|---|---|
committer | 2017-05-08 21:20:38 +0000 | |
commit | 3d33f5cf77e213c512cb773f614f42c6d6a0a789 (patch) | |
tree | e2cd121a01f2853ad207214e6c53279274726370 | |
parent | a28ca7e0924cd0813a2435d013ec6fe59d98cd0a (diff) | |
parent | a3460f2bb1ede89399d126831f9a17fdb8768974 (diff) |
Merge "Fix a NPE with outlineProvider="none"" am: 46a4fbb2e4 am: 65d65ec14b
am: a3460f2bb1
Change-Id: Iccb6dc6a7758abffe2d25bcc8b5dfbb1f600b05c
-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); |