Fix #7798: Refactor scratch canvas usage.

Fixes extra canvas create calls.
Fixes unnecessary call of `new DOMCanvasFactory`.
Fixes undefined error of DOMCanvasFactory.
Fixes failures in some of the tests.
Fixes expected behaviour.
Remove unused vars.
This commit is contained in:
Mukul Mishra 2017-01-27 23:28:39 +05:30
parent e132fa976e
commit 32817633c9
6 changed files with 64 additions and 25 deletions

View file

@ -83,6 +83,8 @@ var WebGLUtils = (function WebGLUtilsClosure() {
if (currentGL) {
return;
}
// The temporary canvas is used in the WebGL context.
currentCanvas = document.createElement('canvas');
currentGL = currentCanvas.getContext('webgl',
{ premultipliedalpha: false });