From 7ba6f430f635ea09d506b4de1774b703c69bf552 Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 22 Oct 2018 13:23:12 -0700 Subject: [PATCH] Clarify createScaledBitmap's 'filter' docs Reddit complained the docs were bad, so make the docs less bad. Test: none Change-Id: I61928ea859af4ce0a63a9b545ea1b6dd965cc3df --- graphics/java/android/graphics/Bitmap.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 853bcff1b4ec2..d6131cf2e5d4c 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -738,7 +738,13 @@ public final class Bitmap implements Parcelable { * @param src The source bitmap. * @param dstWidth The new bitmap's desired width. * @param dstHeight The new bitmap's desired height. - * @param filter true if the source should be filtered. + * @param filter Whether or not bilinear filtering should be used when scaling the + * bitmap. If this is true then bilinear filtering will be used when + * scaling which has better image quality at the cost of worse performance. + * If this is false then nearest-neighbor scaling is used instead which + * will have worse image quality but is faster. Recommended default + * is to set filter to 'true' as the cost of bilinear filtering is + * typically minimal and the improved image quality is significant. * @return The new scaled bitmap or the source bitmap if no scaling is required. * @throws IllegalArgumentException if width is <= 0, or height is <= 0 */