mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-31 03:41:01 +00:00
Highlight resources/history from other parts of the UI in timeline bar
This commit is contained in:
@@ -387,6 +387,8 @@ public:
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
const QVector<PixelModification> &modifications() { return m_ModList; }
|
||||
ResourceId texID() { return m_Tex->ID; }
|
||||
private:
|
||||
ICaptureContext &m_Ctx;
|
||||
|
||||
@@ -617,11 +619,35 @@ PixelHistoryView::PixelHistoryView(ICaptureContext &ctx, ResourceId id, QPoint p
|
||||
|
||||
PixelHistoryView::~PixelHistoryView()
|
||||
{
|
||||
disableTimelineHighlight();
|
||||
|
||||
ui->events->setModel(NULL);
|
||||
m_Ctx.RemoveLogViewer(this);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PixelHistoryView::enableTimelineHighlight()
|
||||
{
|
||||
if(m_Ctx.HasTimelineBar())
|
||||
m_Ctx.GetTimelineBar()->HighlightHistory(m_Model->texID(), m_Model->modifications().toList());
|
||||
}
|
||||
|
||||
void PixelHistoryView::disableTimelineHighlight()
|
||||
{
|
||||
if(m_Ctx.HasTimelineBar())
|
||||
m_Ctx.GetTimelineBar()->HighlightHistory(ResourceId(), {});
|
||||
}
|
||||
|
||||
void PixelHistoryView::enterEvent(QEvent *event)
|
||||
{
|
||||
enableTimelineHighlight();
|
||||
}
|
||||
|
||||
void PixelHistoryView::leaveEvent(QEvent *event)
|
||||
{
|
||||
disableTimelineHighlight();
|
||||
}
|
||||
|
||||
void PixelHistoryView::OnLogfileLoaded()
|
||||
{
|
||||
}
|
||||
@@ -634,6 +660,8 @@ void PixelHistoryView::OnLogfileClosed()
|
||||
void PixelHistoryView::SetHistory(const rdctype::array<PixelModification> &history)
|
||||
{
|
||||
m_Model->setHistory(history);
|
||||
|
||||
enableTimelineHighlight();
|
||||
}
|
||||
|
||||
void PixelHistoryView::startDebug(EventTag tag)
|
||||
|
||||
@@ -58,7 +58,14 @@ private slots:
|
||||
void on_events_customContextMenuRequested(const QPoint &pos);
|
||||
void on_events_doubleClicked(const QModelIndex &index);
|
||||
|
||||
protected:
|
||||
void enterEvent(QEvent *event) override;
|
||||
void leaveEvent(QEvent *event) override;
|
||||
|
||||
private:
|
||||
void enableTimelineHighlight();
|
||||
void disableTimelineHighlight();
|
||||
|
||||
Ui::PixelHistoryView *ui;
|
||||
ICaptureContext &m_Ctx;
|
||||
|
||||
|
||||
@@ -1315,9 +1315,10 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
|
||||
|
||||
if(m_Output != NULL)
|
||||
RT_PickPixelsAndUpdate(r);
|
||||
|
||||
// TODO TimelineBar
|
||||
});
|
||||
|
||||
if(m_Ctx.HasTimelineBar())
|
||||
m_Ctx.GetTimelineBar()->HighlightResourceUsage(texptr->ID);
|
||||
}
|
||||
|
||||
void TextureViewer::UI_SetHistogramRange(const TextureDescription *tex, CompType typeHint)
|
||||
|
||||
Reference in New Issue
Block a user