@Override
  public void renderDeltas(int frameNumber, Canvas canvas) {
    AnimatedImageFrame frame = mAnimatedImage.getFrame(frameNumber);
    AnimatedDrawableFrameInfo frameInfo = mAnimatedImage.getFrameInfo(frameNumber);
    AnimatedDrawableFrameInfo previousFrameInfo =
        frameNumber == 0 ? null : mAnimatedImage.getFrameInfo(frameNumber - 1);
    try {
      if (frame.getWidth() <= 0 || frame.getHeight() <= 0) {
        return; // Frame not visible -> skipping
      }

      if (mAnimatedImage.doesRenderSupportScaling()) {
        renderScalingFrames(canvas, frame, frameInfo, previousFrameInfo);
      } else {
        renderNonScalingFrames(canvas, frame, frameInfo, previousFrameInfo);
      }

    } finally {
      frame.dispose();
    }
  }
An {@link AnimatedDrawableBackend} that renders {@link AnimatedImage}.
animated-base/src/main/java/com/facebook/imagepipeline/animated/impl/AnimatedDrawableBackendImpl.java