summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2018-06-01 15:46:52 -0700
committer android-build-merger <android-build-merger@google.com> 2018-06-01 15:46:52 -0700
commit39636318cad95ef8e720f6837aa18fd781f3696c (patch)
tree513b531656f3193b1b02e4e50b3302a237e32bea
parentfeff976273e1e6780961c1b98bf36726dedc874a (diff)
parentc4f520ddb69eaf5b59e4ee2d55cd83afa331e23c (diff)
Merge "Ensure picture isn't recording in createBitmap" into pi-dev
am: c4f520ddb6 Change-Id: Ia5170bac1cb32c1ce860c01ee499aab134e22ed0
-rw-r--r--graphics/java/android/graphics/Bitmap.java1
-rw-r--r--graphics/java/android/graphics/Picture.java3
2 files changed, 4 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index e8ede94f62bb..95a0c56905c0 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -1232,6 +1232,7 @@ public final class Bitmap implements Parcelable {
if (config == null) {
throw new IllegalArgumentException("Config must not be null");
}
+ source.endRecording();
if (source.requiresHardwareAcceleration() && config != Config.HARDWARE) {
StrictMode.noteSlowCall("GPU readback");
}
diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java
index d01ff6fb8373..ac386979ff5b 100644
--- a/graphics/java/android/graphics/Picture.java
+++ b/graphics/java/android/graphics/Picture.java
@@ -123,6 +123,9 @@ public class Picture {
* drawn to a hardware-accelerated canvas. If this returns true then this Picture can only
* be drawn to another Picture or to a Canvas where canvas.isHardwareAccelerated() is true.
*
+ * Note this value is only updated after recording has finished by a call to
+ * {@link #endRecording()}. Prior to that it will be the default value of false.
+ *
* @return true if the Picture can only be drawn to a hardware-accelerated canvas,
* false otherwise.
*/