import BaseImageResource from './BaseImageResource';

/**
 * Resource type for HTMLCanvasElement.
 * @class
 * @extends PIXI.resources.BaseImageResource
 * @memberof PIXI.resources
 * @param {HTMLCanvasElement} source - Canvas element to use
 */
export default class CanvasResource extends BaseImageResource
{
    /**
     * Used to auto-detect the type of resource.
     *
     * @static
     * @param {*} source - The source object
     * @return {boolean} `true` if <canvas>
     */
    static test(source)
    {
        return (source instanceof HTMLCanvasElement);
    }
}

@@ -397,17 +397,49 @@
 @param %7B
-*
+HTMLCanvasElement%7COffscreenCanvas
 %7D source
@@ -564,16 +564,40 @@
 (source 
+&& (%0A            source 
 instance
@@ -616,16 +616,82 @@
 sElement
+%0A            %7C%7C source instanceof window.OffscreenCanvas%0A        )
 );%0A    %7D

Allow OffscreenCanvas to work as CanvasResource (#5756)