diff options
| author | 2014-09-05 10:33:39 -0700 | |
|---|---|---|
| committer | 2014-09-05 10:33:39 -0700 | |
| commit | 96890564bdbd2f2a41dfc323fc8b3938fb335639 (patch) | |
| tree | cb72083dcb451fca4e1a8ba3c8bf4372a6bf39fb /graphics/java | |
| parent | f634c08b57256bf236c00ce1e917f6299d34e8a1 (diff) | |
Replace native crash with IAE when calling picture.draw() w/ a HW canvas
bug:17397958
Change-Id: I75f942db0e604f9fd6ab31e6c81f718c0f57b16a
Diffstat (limited to 'graphics/java')
| -rw-r--r-- | graphics/java/android/graphics/Canvas.java | 2 | ||||
| -rw-r--r-- | graphics/java/android/graphics/Picture.java | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index f18694b07e59..0927ffd548cf 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -203,7 +203,7 @@ public class Canvas { */ public void setBitmap(@Nullable Bitmap bitmap) { if (isHardwareAccelerated()) { - throw new RuntimeException("Can't set a bitmap device on a GL canvas"); + throw new RuntimeException("Can't set a bitmap device on a HW accelerated canvas"); } if (bitmap == null) { diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java index 5aa7c6a8df52..d28c3d574d05 100644 --- a/graphics/java/android/graphics/Picture.java +++ b/graphics/java/android/graphics/Picture.java @@ -122,6 +122,11 @@ public class Picture { * @param canvas The picture is drawn to this canvas */ public void draw(Canvas canvas) { + if (canvas.isHardwareAccelerated()) { + throw new IllegalArgumentException( + "Picture playback is only supported on software canvas."); + } + if (mRecordingCanvas != null) { endRecording(); } |