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); } }