'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var CanvasPool = require('../../../renderers/shared/texture/CanvasPool.js');

function getTemporaryCanvasFromImage(image, resolution) {
  const canvasAndContext = CanvasPool.CanvasPool.getOptimalCanvasAndContext(
    image.width,
    image.height,
    resolution
  );
  const { context } = canvasAndContext;
  context.clearRect(0, 0, image.width, image.height);
  context.drawImage(image, 0, 0);
  CanvasPool.CanvasPool.returnCanvasAndContext(canvasAndContext);
  return canvasAndContext.canvas;
}

exports.getTemporaryCanvasFromImage = getTemporaryCanvasFromImage;
//# sourceMappingURL=getTemporaryCanvasFromImage.js.map
