private void maybeApplyTransformation(Bitmap bitmap) {
    AnimatedImageResult animatedImageResult = mAnimatedDrawableBackend.getAnimatedImageResult();

    if (animatedImageResult == null) {
      return;
    }

    BitmapTransformation tr = animatedImageResult.getBitmapTransformation();

    if (tr == null) {
      return;
    }

    tr.transform(bitmap);
  }
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