@CalledByNative
  private void onSwapBuffersCompleted() {
    TraceEvent.instant("onSwapBuffersCompleted");

    if (!mFirstFrameReceived
        && mCurrentContentView != null
        && mCurrentContentView.getContentViewCore().isReady()) {
      mFirstFrameReceived = true;
      if (mFirstRenderedFrameListener != null) {
        mFirstRenderedFrameListener.onFirstFrameReceived();
      }
    }

    if (mPendingSwapBuffers == MAX_SWAP_BUFFER_COUNT && mNeedToRender) requestRender();
    if (mPendingSwapBuffers > 0) mPendingSwapBuffers--;
  }
 public void registerFirstRenderedFrameListener(FirstRenderedFrameListener listener) {
   mFirstRenderedFrameListener = listener;
   if (mFirstFrameReceived && mFirstRenderedFrameListener != null) {
     mFirstRenderedFrameListener.onFirstFrameReceived();
   }
 }