From 4ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1 Mon Sep 17 00:00:00 2001
From: Romain Guy (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