mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Refactor render. Disabling WebGL render for now.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
function CanvasRender(canvasElement, options) {
|
||||
this.options = options
|
||||
this.context = canvasElement.getContext('2d')
|
||||
}
|
||||
|
||||
CanvasRender.prototype.draw = function (image) {
|
||||
this.context.drawImage(image, 0, 0)
|
||||
}
|
||||
|
||||
CanvasRender.prototype.clear = function () {
|
||||
this.context.clearRect(0, 0, this.context.canvas.width,
|
||||
this.context.canvas.height)
|
||||
}
|
||||
|
||||
// Check for Non CommonJS world
|
||||
if (typeof module !== 'undefined') {
|
||||
module.exports = {
|
||||
CanvasRender: CanvasRender
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user