surfaces/CanvasSurface.js
function CanvasSurface(options) {
    if (options)
        options.useTarget = true;
    else
        options = { useTarget: true };

    if (options.canvasSize) this._canvasSize = options.canvasSize;
    Surface.apply(this, arguments);
    if (!this._canvasSize) this._canvasSize = this.getSize();
    this._backBuffer = document.createElement('canvas');
    if (this._canvasSize) {
        this._backBuffer.width = this._canvasSize[0];
        this._backBuffer.height = this._canvasSize[1];
    }
    this._contextId = undefined;
}
function CanvasSurface(options) {
    if (options)
        options.useTarget = true;
    else
        options = { useTarget: true };

    if (options.canvasSize) this._canvasSize = options.canvasSize;
    Surface.apply(this, arguments);
    if (!this._canvasSize) this._canvasSize = this.getSize();
    this._backBuffer = document.createElement('canvas');
    if (this._canvasSize) {
        this._backBuffer.width = this._canvasSize[0];
        this._backBuffer.height = this._canvasSize[1];
    }
    this._contextId = undefined;
}
function CanvasSurface ( options ) { if ( options ) options . useTarget = true ; else options = { useTarget : true } ; if ( options . canvasSize ) this . _canvasSize = options . canvasSize ; Surface . apply ( this , arguments ) ; if ( ! this . _canvasSize ) this . _canvasSize = this . getSize ( ) ; this . _backBuffer = document . createElement ( 'canvas' ) ; if ( this . _canvasSize ) { this . _backBuffer . width = this . _canvasSize [ 0 ] ; this . _backBuffer . height = this . _canvasSize [ 1 ] ; } this . _contextId = undefined ; }
A surface containing an HTML5 Canvas element.
This extends the Surface class.

@class CanvasSurface
@extends Surface
@constructor
@param {Object} [options] overrides of default options
@param {Array.Number} [options.canvasSize] [width, height] for document element
A surface containing an HTML5 Canvas element . This extends the Surface class .