Merge "Ensure picture isn't recording in createBitmap" into pi-dev

am: c4f520ddb6

Change-Id: Ia5170bac1cb32c1ce860c01ee499aab134e22ed0
This commit is contained in:
John Reck
2018-06-01 15:46:52 -07:00
committed by android-build-merger
2 changed files with 4 additions and 0 deletions

View File

@@ -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");
}

View File

@@ -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.
*/