summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Sergey Prigogin <sprigogin@google.com> 2017-05-08 21:12:37 +0000
committer android-build-merger <android-build-merger@google.com> 2017-05-08 21:12:37 +0000
commita3460f2bb1ede89399d126831f9a17fdb8768974 (patch)
tree86e6074f924c1fcacff456603f25d3f9aa48801c
parent6ab3ce1219547729376703b816dd2ac1b21214d4 (diff)
parent65d65ec14be2a1f3732c711f5f2be5e34e526bea (diff)
Merge "Fix a NPE with outlineProvider="none"" am: 46a4fbb2e4
am: 65d65ec14b Change-Id: Iae0cc89cea82009620a75ac03de86a72ea20f1bb
-rw-r--r--tools/layoutlib/bridge/src/android/view/ViewGroup_Delegate.java14
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);