private boolean isKeyFrame(int index) {
    if (index == 0) {
      return true;
    }
    AnimatedDrawableFrameInfo currFrameInfo = mAnimatedDrawableBackend.getFrameInfo(index);
    AnimatedDrawableFrameInfo prevFrameInfo = mAnimatedDrawableBackend.getFrameInfo(index - 1);
    if (currFrameInfo.blendOperation == BlendOperation.NO_BLEND && isFullFrame(currFrameInfo)) {
      return true;
    } else
      return prevFrameInfo.disposalMethod == DisposalMethod.DISPOSE_TO_BACKGROUND
          && isFullFrame(prevFrameInfo);
  }
Returns whether the specified frame is needed for rendering the next frame. This is part of the
compositing logic. See {@link FrameNeededResult} for more info about the results.

@param index the frame to check
@return whether the frame is required taking into account special conditions
animated-base/src/main/java/com/facebook/imagepipeline/animated/impl/AnimatedImageCompositor.java