UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

2 lines (1 loc) 1.07 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=require("./Graph.js"),t=require("./TexturePool.js"),r=require("../FrameBuffer.js"),u=e.default.extend((function(){return{_outputs:[],_texturePool:new t.default,_frameBuffer:new r.default({depthBuffer:!1})}}),{addNode:function(t){e.default.prototype.addNode.call(this,t),t._compositor=this},render:function(e,t){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var r=0;r<this.nodes.length;r++)this.nodes[r].outputs||this._outputs.push(this.nodes[r])}for(r=0;r<this.nodes.length;r++)this.nodes[r].beforeFrame();for(r=0;r<this._outputs.length;r++)this._outputs[r].updateReference();for(r=0;r<this._outputs.length;r++)this._outputs[r].render(e,t);for(r=0;r<this.nodes.length;r++)this.nodes[r].afterFrame()},allocateTexture:function(e){return this._texturePool.get(e)},releaseTexture:function(e){this._texturePool.put(e)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(e){this._texturePool.clear(e)}});exports.default=u;