|
@@ -135,7 +135,17 @@ Object.assign( Texture.prototype, EventDispatcher.prototype, {
|
|
|
canvas.width = image.width;
|
|
|
canvas.height = image.height;
|
|
|
|
|
|
- canvas.getContext( '2d' ).drawImage( image, 0, 0, image.width, image.height );
|
|
|
+ var context = canvas.getContext( '2d' );
|
|
|
+
|
|
|
+ if ( image instanceof ImageData ) {
|
|
|
+
|
|
|
+ context.putImageData( image, 0, 0 );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ context.drawImage( image, 0, 0, image.width, image.height );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|