@Override
  public void renderFrame(int frameNumber, Canvas canvas) {
    int[] pixels = new int[mWidth * mHeight];
    for (int i = 0; i < pixels.length; i++) {
      // We store the frame number in the R, the x in the G, and the y in the B.
      int x = i % mWidth;
      int y = i / mWidth;
      pixels[i] = pixelValue(frameNumber, x, y);
    }
    Bitmap bitmap = Bitmap.createBitmap(pixels, mWidth, mHeight, Bitmap.Config.ARGB_8888);
    canvas.drawBitmap(bitmap, 0, 0, null);
  }
Implementation of {@link AnimatedDrawableBackend} for unit tests.
animated-base/src/test/java/com/facebook/imagepipeline/animated/testing/TestAnimatedDrawableBackend.java