(canvasType)
| 140 | * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. |
| 141 | */ |
| 142 | var first = function (canvasType) |
| 143 | { |
| 144 | if (canvasType === undefined) { canvasType = CONST.CANVAS; } |
| 145 | |
| 146 | if (canvasType === CONST.WEBGL) |
| 147 | { |
| 148 | return null; |
| 149 | } |
| 150 | |
| 151 | for (var i = 0; i < pool.length; i++) |
| 152 | { |
| 153 | var container = pool[i]; |
| 154 | |
| 155 | if (!container.parent && container.type === canvasType) |
| 156 | { |
| 157 | return container; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | return null; |
| 162 | }; |
| 163 | |
| 164 | /** |
| 165 | * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. |
no outgoing calls
no test coverage detected
searching dependent graphs…