From 4580ae129359fb56467ed125af8fd77ad521dbf8 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Tue, 5 Mar 2019 10:02:12 -0500 Subject: Explain why Bitmap#setColorSpace is @NonNull Bug: 127282638 Test: No change in behavior Change-Id: I167893b1d80ae37982804ec0dfa98b68d6eaab53 --- graphics/java/android/graphics/Bitmap.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'graphics/java/android') diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 18eafa61aa48..2e56e09522e9 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -1718,6 +1718,11 @@ public final class Bitmap implements Parcelable { *

Modifies the bitmap to have the specified {@link ColorSpace}, without * affecting the underlying allocation backing the bitmap.

* + *

This affects how the framework will interpret the color at each pixel. A bitmap + * with {@link Config#ALPHA_8} never has a color space, since a color space does not + * affect the alpha channel. Other {@code Config}s must always have a non-null + * {@code ColorSpace}.

+ * * @throws IllegalArgumentException If the specified color space is {@code null}, not * {@link ColorSpace.Model#RGB RGB}, has a transfer function that is not an * {@link ColorSpace.Rgb.TransferParameters ICC parametric curve}, or whose -- cgit v1.2.3-59-g8ed1b