Add columns in entity list for render performance information

This commit is contained in:
David Rowe 2016-08-26 15:16:23 +12:00
parent 8d5a896ccf
commit 1147adae78
5 changed files with 97 additions and 24 deletions

View file

@ -580,6 +580,17 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_CLIENT_ONLY, clientOnly);
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_OWNING_AVATAR_ID, owningAvatarID);
// Rendering info
if (!skipDefaults) {
QScriptValue renderInfo = engine->newObject();
renderInfo.setProperty("verticesCount", QScriptValue(10));
renderInfo.setProperty("texturesCount", QScriptValue(2));
renderInfo.setProperty("texturesSize", QScriptValue(1024));
renderInfo.setProperty("hasTransparent", QScriptValue(false));
renderInfo.setProperty("drawCalls", QScriptValue(30));
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER_NO_SKIP(renderInfo, renderInfo); // Gettable but not settable
}
properties.setProperty("clientOnly", convertScriptValue(engine, getClientOnly()));
properties.setProperty("owningAvatarID", convertScriptValue(engine, getOwningAvatarID()));

View file

@ -906,16 +906,38 @@ textarea:enabled[scrolling="true"]::-webkit-resizer {
}
#col-type {
width: 16%;
width: 10%;
}
#col-name {
width: 34%;
width: 20%;
}
#col-url {
width: 34%;
width: 20%;
}
#col-locked, #col-visible {
width: 8%;
width: 4%;
}
#col-verticesCount {
width: 10%;
}
#col-texturesCount {
width: 10%;
}
#col-texturesSize {
width: 10%;
}
#col-hasTransparent {
width: 4%;
}
#col-drawCalls {
width: 10%;
}
#col-hasScript {
width: 4%;
}
.verticesCount, .texturesCount, .texturesSize, .drawCalls {
text-align: right;
}
#entity-table thead tr, #entity-table thead tr th,

View file

@ -37,19 +37,31 @@
<div id="entity-table-scroll">
<table id="entity-table">
<colgroup>
<col span="1" id="col-type" />
<col span="1" id="col-name" />
<col span="1" id="col-url" />
<col span="1" id="col-locked" />
<col span="1" id="col-visible" />
<col span="1" id="col-type" />
<col span="1" id="col-name" />
<col span="1" id="col-url" />
<col span="1" id="col-locked" />
<col span="1" id="col-visible" />
<col span="1" id="col-verticesCount" />
<col span="1" id="col-texturesCount" />
<col span="1" id="col-texturesSize" />
<col span="1" id="col-hasTransparent" />
<col span="1" id="col-drawCalls" />
<col span="1" id="col-hasScript" />
</colgroup>
<thead>
<tr>
<th id="entity-type" data-sort="type">Type<span class="sort-order"></span></th>
<th id="entity-name" data-sort="type">Name<span class="sort-order"></span></th>
<th id="entity-url" data-sort="url">File<span class="sort-order"></span></th>
<th id="entity-locked" data-sort="locked"><span class="glyph">&#xe006;</span><span class="sort-order"></span></th>
<th colspan="2" id="entity-visible" data-sort="visible"><span class="glyph">&#xe007;</span><span class="sort-order"></span></th>
<th id="entity-type">Type<span class="sort-order"></span></th>
<th id="entity-name">Name<span class="sort-order"></span></th>
<th id="entity-url">File<span class="sort-order"></span></th>
<th id="entity-locked"><span class="glyph">&#xe006;</span><span class="sort-order"></span></th>
<th id="entity-visible"><span class="glyph">&#xe007;</span><span class="sort-order"></span></th>
<th id="entity-verticesCount">V</th>
<th id="entity-texturesCount">T</th>
<th id="entity-texturesSize">S</th>
<th id="entity-hasTransparent">T</th>
<th id="entity-drawCalls">D</th>
<th colspan="2" id="entity-hasScript">S</th>
</tr>
</thead>
<tbody class="list" id="entity-table-body">
@ -59,12 +71,18 @@
<td class="url"><div class='outer'><div class='inner'>URL</div></div></td>
<td class="locked glyph">?</td>
<td class="visible glyph">?</td>
<td class="verticesCount"></td>
<td class="texturesCount"></td>
<td class="texturesSize"></td>
<td class="hasTransparent"></td>
<td class="drawCalls"></td>
<td class="hasScript"></td>
<td class="id" style="display: none">ID</td>
</tr>
</tbody>
<tfoot>
<tr>
<td id="footer-text" colspan="5"> </td>
<td id="footer-text" colspan="11"> </td>
</tr>
</tfoot>
</table>

View file

@ -106,12 +106,18 @@ function loaded() {
}));
}
function addEntity(id, name, type, url, locked, visible) {
function addEntity(id, name, type, url, locked, visible, verticesCount, texturesCount, texturesSize, hasTransparent,
drawCalls, hasScript) {
var urlParts = url.split('/');
var filename = urlParts[urlParts.length - 1];
if (entities[id] === undefined) {
entityList.add([{ id: id, name: name, type: type, url: filename, locked: locked, visible: visible }],
entityList.add([{
id: id, name: name, type: type, url: filename, locked: locked, visible: visible, verticesCount: verticesCount,
texturesCount: texturesCount, texturesSize: texturesSize, hasTransparent: hasTransparent,
drawCalls: drawCalls, hasScript: hasScript
}],
function (items) {
var currentElement = items[0].elm;
var id = items[0]._values.id;
@ -264,7 +270,11 @@ function loaded() {
var id = newEntities[i].id;
addEntity(id, newEntities[i].name, newEntities[i].type, newEntities[i].url,
newEntities[i].locked ? LOCKED_GLYPH : null,
newEntities[i].visible ? VISIBLE_GLYPH : null);
newEntities[i].visible ? VISIBLE_GLYPH : null,
newEntities[i].verticesCount, newEntities[i].texturesCount, newEntities[i].texturesSize,
newEntities[i].hasTransparent ? "T" : null,
newEntities[i].drawCalls,
newEntities[i].hasScript ? "T" : null);
}
updateSelectedEntities(data.selectedIDs);
resize();
@ -288,11 +298,17 @@ function loaded() {
} else {
// Reasonable widths if nothing is displayed
var tableWidth = document.getElementById("entity-table").offsetWidth;
ths[0].width = 0.16 * tableWidth;
ths[1].width = 0.34 * tableWidth;
ths[2].width = 0.34 * tableWidth;
ths[3].width = 0.08 * tableWidth;
ths[4].width = 0.08 * tableWidth;
ths[0].width = 0.10 * tableWidth;
ths[1].width = 0.20 * tableWidth;
ths[2].width = 0.20 * tableWidth;
ths[3].width = 0.04 * tableWidth;
ths[4].width = 0.04 * tableWidth;
ths[5].width = 0.10 * tableWidth;
ths[6].width = 0.10 * tableWidth;
ths[7].width = 0.10 * tableWidth;
ths[8].width = 0.04 * tableWidth;
ths[9].width = 0.10 * tableWidth;
ths[10].width = 0.04 * tableWidth;
}
};

View file

@ -60,7 +60,13 @@ EntityListTool = function(opts) {
type: properties.type,
url: properties.type == "Model" ? properties.modelURL : "",
locked: properties.locked,
visible: properties.visible
visible: properties.visible,
verticesCount: properties.renderInfo.verticesCount,
texturesCount: properties.renderInfo.texturesCount,
texturesSize:properties.renderInfo.texturesSize,
hasTransparent: properties.renderInfo.hasTransparent,
drawCalls: properties.renderInfo.drawCalls,
hasScript: properties.script !== ""
});
}