Implement empty-marker hiding options for event browser

This commit is contained in:
baldurk
2018-10-04 16:07:36 +01:00
parent 8879d9a9bf
commit 995caa2636
2 changed files with 55 additions and 0 deletions
+54
View File
@@ -276,6 +276,57 @@ void EventBrowser::OnEventChanged(uint32_t eventId)
highlightBookmarks();
}
bool EventBrowser::ShouldHide(const DrawcallDescription &drawcall)
{
if(drawcall.flags & DrawFlags::PushMarker)
{
if(m_Ctx.Config().EventBrowser_HideEmpty)
{
if(drawcall.children.isEmpty())
return true;
bool allhidden = true;
for(const DrawcallDescription &child : drawcall.children)
{
if(ShouldHide(child))
continue;
allhidden = false;
break;
}
if(allhidden)
return true;
}
if(m_Ctx.Config().EventBrowser_HideAPICalls)
{
if(drawcall.children.isEmpty())
return false;
bool onlyapi = true;
for(const DrawcallDescription &child : drawcall.children)
{
if(ShouldHide(child))
continue;
if(!(child.flags & DrawFlags::APICalls))
{
onlyapi = false;
break;
}
}
if(onlyapi)
return true;
}
}
return false;
}
QPair<uint32_t, uint32_t> EventBrowser::AddDrawcalls(RDTreeWidgetItem *parent,
const rdcarray<DrawcallDescription> &draws)
{
@@ -285,6 +336,9 @@ QPair<uint32_t, uint32_t> EventBrowser::AddDrawcalls(RDTreeWidgetItem *parent,
{
const DrawcallDescription &d = draws[i];
if(ShouldHide(d))
continue;
QVariant name = QString(d.name);
RichResourceTextInitialise(name);