summaryrefslogtreecommitdiff
path: root/graphics/java
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/Canvas.java2
-rw-r--r--graphics/java/android/graphics/Picture.java5
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();
}