DrawableTransformationTest.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:GitHub 作者:
@Test
public void load_withColorDrawable_fixedSize_functionalBitmapTransform_doesNotRecycleOutput()
    throws ExecutionException, InterruptedException {
  Drawable colorDrawable = new ColorDrawable(Color.RED);

  int width = 100;
  int height = 200;

  Drawable result = GlideApp.with(context)
      .load(colorDrawable)
      .circleCrop()
      .override(width, height)
      .submit()
      .get();

   BitmapSubject.assertThat(result).isNotRecycled();

  BitmapPool bitmapPool = Glide.get(context).getBitmapPool();
  // Make sure we didn't put the same Bitmap twice.
  Bitmap first = bitmapPool.get(width, height, Config.ARGB_8888);
  Bitmap second = bitmapPool.get(width, height, Config.ARGB_8888);

  assertThat(first).isNotSameAs(second);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号