From 4064e118e2d738ddd13366bf08210bb8de9e32ca Mon Sep 17 00:00:00 2001 From: Deepanshu Gupta Date: Wed, 7 Oct 2015 09:26:46 -0700 Subject: Skip drawing empty shapes to keep Apple JRE happy. Bug: http://b.android.com/178278 Change-Id: I693912678ed79e9c6690560b618a605da5a807c6 --- tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools') diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java index f8b3739..64cd503 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java @@ -35,6 +35,8 @@ import java.awt.RenderingHints; import java.awt.Shape; import java.awt.geom.AffineTransform; import java.awt.geom.Arc2D; +import java.awt.geom.Path2D; +import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; @@ -707,6 +709,12 @@ public final class Canvas_Delegate { @Override public void draw(Graphics2D graphics, Paint_Delegate paintDelegate) { Shape shape = pathDelegate.getJavaShape(); + Rectangle2D bounds = shape.getBounds2D(); + if (bounds.isEmpty()) { + // Apple JRE 1.6 doesn't like drawing empty shapes. + // http://b.android.com/178278 + return; + } int style = paintDelegate.getStyle(); if (style == Paint.Style.FILL.nativeInt || -- cgit v1.1