@Override public void draw(Canvas canvas){
  final boolean clearColorFilter;
  if (mTintFilter != null && mPaint.getColorFilter() == null) {
    mPaint.setColorFilter(mTintFilter);
    clearColorFilter=true;
  }
 else {
    clearColorFilter=false;
  }
  if (mPaint.getShader() == null) {
    canvas.drawBitmap(mBuffer,mSrcRect,mDstRect,mPaint);
  }
 else {
    canvas.drawRect(mDstRect,mPaint);
  }
  if (clearColorFilter) {
    mPaint.setColorFilter(null);
  }
  if (mIsRenderingTriggeredOnDraw && mIsRunning && mNextFrameRenderTime != Long.MIN_VALUE) {
    final long renderDelay=Math.max(0,mNextFrameRenderTime - SystemClock.uptimeMillis());
    mNextFrameRenderTime=Long.MIN_VALUE;
    mExecutor.remove(mRenderTask);
    mSchedule=mExecutor.schedule(mRenderTask,renderDelay,TimeUnit.MILLISECONDS);
  }
}

@ Override public void draw ( Canvas canvas ) { final boolean clearColorFilter ; if ( mTintFilter != null && mPaint . getColorFilter ( ) == null ) { mPaint . setColorFilter ( mTintFilter ) ; clearColorFilter = true ; } else { clearColorFilter = false ; } if ( mPaint . getShader ( ) == null ) { canvas . drawBitmap ( mBuffer , mSrcRect , mDstRect , mPaint ) ; } else { canvas . drawRect ( mDstRect , mPaint ) ; } if ( clearColorFilter ) { mPaint . setColorFilter ( null ) ; } if ( mIsRenderingTriggeredOnDraw && mIsRunning && mNextFrameRenderTime != Long . MIN_VALUE ) { final long renderDelay = Math . max ( 0 , mNextFrameRenderTime - SystemClock . uptimeMillis ( ) ) ; mNextFrameRenderTime = Long . MIN_VALUE ; mExecutor . remove ( mRenderTask ) ; mSchedule = mExecutor . schedule ( mRenderTask , renderDelay , TimeUnit . MILLISECONDS ) ; } }
reads and renders new frame if needed then draws last rendered frame .
