@TargetApi(Build.VERSION_CODES.KITKAT)
  private void drawTile(View measuredView, int i, int j, RecordBuilderImpl recordBuilder)
      throws IOException {
    int width = measuredView.getWidth();
    int height = measuredView.getHeight();
    int left = i * mTileSize;
    int top = j * mTileSize;
    int right = Math.min(left + mTileSize, width);
    int bottom = Math.min(top + mTileSize, height);

    lazyInitBitmap();

    if (mEnableBitmapReconfigure) {
      Preconditions.checkNotNull(mBitmap)
          .reconfigure(right - left, bottom - top, Bitmap.Config.ARGB_8888);
      mCanvas = new Canvas(mBitmap);
    }
    // NULLSAFE_FIXME[Parameter Not Nullable]
    clearCanvas(mCanvas);

    // NULLSAFE_FIXME[Parameter Not Nullable]
    drawClippedView(measuredView, left, top, mCanvas);
    // NULLSAFE_FIXME[Parameter Not Nullable]
    String tempName = mAlbum.writeBitmap(recordBuilder.getName(), i, j, mBitmap);
    if (tempName == null) {
      throw new NullPointerException();
    }
    recordBuilder.getTiling().setAt(left / mTileSize, top / mTileSize, tempName);
  }
Snaps a screenshot of the view (which should already be measured and layouted) using testName
as the name.
core/src/main/java/com/facebook/testing/screenshot/internal/ScreenshotImpl.java