From 4ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 6 Aug 2012 14:51:10 -0700 Subject: Add new debug tool to track hardware layers updates You can setprop debug.hwui.show_layers_updates true to flash hw layers in green when they update. This is also a setting in the Dev. section of the settings app. Change-Id: Ibe1d63a4f81567dc1d590c9b088d2e7505df8abf --- graphics/java/android/graphics/Bitmap.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'graphics/java/android') diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 128adcbf53a2..6ba57809f3e6 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -881,15 +881,17 @@ public final class Bitmap implements Parcelable { * (128, 128, 0, 0).

* *

This method always returns false if {@link #getConfig()} is - * {@link Bitmap.Config#ALPHA_8} or {@link Bitmap.Config#RGB_565}.

+ * {@link Bitmap.Config#RGB_565}.

+ * + *

This method only returns true if {@link #hasAlpha()} returns true. + * A bitmap with no alpha channel can be used both as a pre-multiplied and + * as a non pre-multiplied bitmap.

* * @return true if the underlying pixels have been pre-multiplied, false * otherwise */ public final boolean isPremultiplied() { - final Config config = getConfig(); - //noinspection deprecation - return config == Config.ARGB_8888 || config == Config.ARGB_4444; + return getConfig() != Config.RGB_565 && hasAlpha(); } /** Returns the bitmap's width */ -- cgit v1.2.3-59-g8ed1b