bytev-charts-beta
Version:
基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;
61 lines (55 loc) • 1.45 kB
JavaScript
import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck";
import _createClass from "@babel/runtime-corejs2/helpers/createClass";
var WebGPUInfo = /*#__PURE__*/function () {
function WebGPUInfo() {
_classCallCheck(this, WebGPUInfo);
this.autoReset = true;
this.render = {
frame: 0,
drawCalls: 0,
triangles: 0,
points: 0,
lines: 0
};
this.memory = {
geometries: 0,
textures: 0
};
}
_createClass(WebGPUInfo, [{
key: "update",
value: function update(object, count) {
this.render.drawCalls++;
if (object.isMesh) {
this.render.triangles += count / 3;
} else if (object.isPoints) {
this.render.points += count;
} else if (object.isLineSegments) {
this.render.lines += count / 2;
} else if (object.isLine) {
this.render.lines += count - 1;
} else {
console.error('THREE.WebGPUInfo: Unknown object type.');
}
}
}, {
key: "reset",
value: function reset() {
this.render.frame++;
this.render.drawCalls = 0;
this.render.triangles = 0;
this.render.points = 0;
this.render.lines = 0;
}
}, {
key: "dispose",
value: function dispose() {
this.reset();
this.render.frame = 0;
this.memory.geometries = 0;
this.memory.textures = 0;
}
}]);
return WebGPUInfo;
}();
export default WebGPUInfo;