protected void onNewResultImpl()

in imagepipeline/src/main/java/com/facebook/imagepipeline/producers/ResizeAndRotateProducer.java [145:179]


    protected void onNewResultImpl(@Nullable EncodedImage newResult, @Status int status) {
      if (mIsCancelled) {
        return;
      }
      boolean isLast = isLast(status);
      if (newResult == null) {
        if (isLast) {
          getConsumer().onNewResult(null, Consumer.IS_LAST);
        }
        return;
      }
      ImageFormat imageFormat = newResult.getImageFormat();
      TriState shouldTransform =
          shouldTransform(
              mProducerContext.getImageRequest(),
              newResult,
              Preconditions.checkNotNull(
                  mImageTranscoderFactory.createImageTranscoder(imageFormat, mIsResizingEnabled)));
      // ignore the intermediate result if we don't know what to do with it
      if (!isLast && shouldTransform == TriState.UNSET) {
        return;
      }
      // just forward the result if we know that it shouldn't be transformed
      if (shouldTransform != TriState.YES) {
        forwardNewResult(newResult, status, imageFormat);
        return;
      }
      // we know that the result should be transformed, hence schedule it
      if (!mJobScheduler.updateJob(newResult, status)) {
        return;
      }
      if (isLast || mProducerContext.isIntermediateResultExpected()) {
        mJobScheduler.scheduleJob();
      }
    }