copyPixels method

void copyPixels(
  1. BitmapData source,
  2. Rectangle<num> sourceRect,
  3. Point<num> destPoint
)

Implementation

void copyPixels(
    BitmapData source, Rectangle<num> sourceRect, Point<num> destPoint) {
  final sourceQuad = source.renderTextureQuad.cut(sourceRect);
  final renderState = RenderState(_renderContext, _drawMatrix);
  renderState.globalMatrix.prependTranslation(destPoint.x, destPoint.y);
  _renderContext.setTransform(renderState.globalMatrix);
  _renderContext.rawContext
      .clearRect(0, 0, sourceRect.width, sourceRect.height);
  _renderContext.renderTextureQuad(renderState, sourceQuad);
}