GoodBoyDigital/pixi.js — pull request #7 by amadeus (2013-03-16 22:49:26+00:00)
Title: Allowing Renderer's to accept a pre-made canvas/view

The reason for this commit is to allow support for previously created
canvases to be specified as views.

The major usecase here is Ejecta, who's primary screen canvas is always
obtained through document.getElementById('canvas'); Thus, creating a
canvas using document.createElement('canvas') would only make an
offscreen canvas which wouldn't be visible.

This commit maintains backwards compatibility since specifying a canvas
is completely optional, and if none is specified, it falls back to
previous behaviour.

Please note: There is a major bug with Ejecta currently that I have reported that doesn't allow assets to be loaded properly. Once it is sorted, Pixi.js should work fine within Ejecta as long as you specify the view on Renderer instantiation.