Source
RenderFrameBuffer getRenderFrameBuffer(int width, int height) {
if (_renderFrameBufferPool.length == 0) {
return new RenderFrameBuffer.rawWebGL(width, height);
} else {
var renderFrameBuffer = _renderFrameBufferPool.removeLast();
var renderTexture = renderFrameBuffer.renderTexture;
var renderStencilBuffer = renderFrameBuffer.renderStencilBuffer;
if (renderTexture.width != width || renderTexture.height != height) {
releaseRenderTexture(renderTexture);
renderTexture.resize(width, height);
renderStencilBuffer.resize(width, height);
}
return renderFrameBuffer;
}
}