AttachmentRegionDecoder.java 文件源码

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

项目:Cable-Android 作者:
@RequiresApi(api = Build.VERSION_CODES.GINGERBREAD_MR1)
@Override
public Bitmap decodeRegion(Rect rect, int sampleSize) {
  Log.w(TAG, "Decode region: " + rect);

  if (passthrough != null) {
    return passthrough.decodeRegion(rect, sampleSize);
  }

  synchronized(this) {
    BitmapFactory.Options options = new BitmapFactory.Options();
    options.inSampleSize      = sampleSize;
    options.inPreferredConfig = Bitmap.Config.RGB_565;

    Bitmap bitmap = bitmapRegionDecoder.decodeRegion(rect, options);

    if (bitmap == null) {
      throw new RuntimeException("Skia image decoder returned null bitmap - image format may not be supported");
    }

    return bitmap;
  }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号