diff options
| author | 2017-05-08 21:01:07 +0000 | |
|---|---|---|
| committer | 2017-05-08 21:01:07 +0000 | |
| commit | 65d65ec14be2a1f3732c711f5f2be5e34e526bea (patch) | |
| tree | 059fc57e2f34abc6ab299cba17a28f5e110c5f56 | |
| parent | a37bef769a19c8189612c8c956c374b231176739 (diff) | |
| parent | 46a4fbb2e497d13a9a93f67beef68c047005c247 (diff) | |
Merge "Fix a NPE with outlineProvider="none""
am: 46a4fbb2e4
Change-Id: Ib14f6b5369d60c06a716b99dd0274872fc0d2a51
| -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); |