summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDeepanshu Gupta <deepanshu@google.com>2015-10-07 17:08:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-07 17:08:30 +0000
commit8db8bc63624bbd1d803e02571fa865f1f7fa584c (patch)
tree6a67c8c6ed6be0764a699581c89a0c3fb2a7468e /tools
parent081cebf52b19e848c07fb781b35fa1f96695c311 (diff)
parent4064e118e2d738ddd13366bf08210bb8de9e32ca (diff)
downloadframeworks_base-8db8bc63624bbd1d803e02571fa865f1f7fa584c.zip
frameworks_base-8db8bc63624bbd1d803e02571fa865f1f7fa584c.tar.gz
frameworks_base-8db8bc63624bbd1d803e02571fa865f1f7fa584c.tar.bz2
Merge "Skip drawing empty shapes to keep Apple JRE happy." into mnc-ub-dev
Diffstat (limited to 'tools')
-rw-r--r--tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java8
1 files changed, 8 insertions, 0 deletions
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 ||