Java 类com.facebook.imagepipeline.animated.util.AnimatedDrawableUtil 实例源码

项目:GitHub    文件:AnimatedDrawableBackendImpl.java   
public AnimatedDrawableBackendImpl(
    AnimatedDrawableUtil animatedDrawableUtil,
    AnimatedImageResult animatedImageResult,
    Rect bounds) {
  mAnimatedDrawableUtil = animatedDrawableUtil;
  mAnimatedImageResult = animatedImageResult;
  mAnimatedImage = animatedImageResult.getImage();
  mFrameDurationsMs = mAnimatedImage.getFrameDurations();
  mAnimatedDrawableUtil.fixFrameDurations(mFrameDurationsMs);
  mDurationMs = mAnimatedDrawableUtil.getTotalDurationFromFrameDurations(mFrameDurationsMs);
  mFrameTimestampsMs = mAnimatedDrawableUtil.getFrameTimeStampsFromDurations(mFrameDurationsMs);
  mRenderedBounds = getBoundsToUse(mAnimatedImage, bounds);
  mFrameInfos = new AnimatedDrawableFrameInfo[mAnimatedImage.getFrameCount()];
  for (int i = 0; i < mAnimatedImage.getFrameCount(); i++) {
    mFrameInfos[i] = mAnimatedImage.getFrameInfo(i);
  }
}
项目:fresco    文件:AnimatedDrawableBackendImpl.java   
public AnimatedDrawableBackendImpl(
    AnimatedDrawableUtil animatedDrawableUtil,
    AnimatedImageResult animatedImageResult,
    Rect bounds) {
  mAnimatedDrawableUtil = animatedDrawableUtil;
  mAnimatedImageResult = animatedImageResult;
  mAnimatedImage = animatedImageResult.getImage();
  mFrameDurationsMs = mAnimatedImage.getFrameDurations();
  mAnimatedDrawableUtil.fixFrameDurations(mFrameDurationsMs);
  mDurationMs = mAnimatedDrawableUtil.getTotalDurationFromFrameDurations(mFrameDurationsMs);
  mFrameTimestampsMs = mAnimatedDrawableUtil.getFrameTimeStampsFromDurations(mFrameDurationsMs);
  mRenderedBounds = getBoundsToUse(mAnimatedImage, bounds);
  mFrameInfos = new AnimatedDrawableFrameInfo[mAnimatedImage.getFrameCount()];
  for (int i = 0; i < mAnimatedImage.getFrameCount(); i++) {
    mFrameInfos[i] = mAnimatedImage.getFrameInfo(i);
  }
}