提交 c441d83d 编写于 作者: S Sam Judd

Avoid asserting that Android can decode hardware Bitmaps for wide gamut images.

上级 a55e935e
......@@ -12,9 +12,9 @@ import android.graphics.ColorSpace.Named;
import android.os.Build;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.engine.bitmap_recycle.LruBitmapPool;
import com.bumptech.glide.load.resource.bitmap.Downsampler;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.test.ConcurrencyHelper;
import com.bumptech.glide.test.GlideApp;
......@@ -71,16 +71,19 @@ public class WideGamutTest {
assertThat(bitmap).isSameAs(expected);
}
// TODO: Even with hardware allowed, we get a wide F16. Attempting to decode the resource with
// preferred config set to hardware fails with:
// "D/skia (10312): --- Failed to allocate a hardware bitmap"
@Test
public void load_withWideGamutImage_hardwareAllowed_returnsHardwareBitmap() {
public void load_withWideGamutImage_hardwareAllowed_returnsDecodedBitmap() {
Bitmap bitmap =
concurrency.get(
GlideApp.with(context)
.asBitmap()
.format(DecodeFormat.PREFER_ARGB_8888)
.load(ResourceIds.raw.webkit_logo_p3)
.set(Downsampler.ALLOW_HARDWARE_CONFIG, true)
.submit());
assertThat(bitmap.getConfig()).isEqualTo(Bitmap.Config.HARDWARE);
assertThat(bitmap).isNotNull();
}
@Test
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册