From: James Benton Date: Wed, 22 Aug 2012 14:25:42 +0000 (+0100) Subject: Add cpu/gpu label to histograms. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=661baf14834d3efc1d9d9b5416223c9a27c3d415;hp=dd2a1c0627d0a64903878bec5d6dcb2cd69fd443;p=apitrace Add cpu/gpu label to histograms. --- diff --git a/gui/graphwidget.cpp b/gui/graphwidget.cpp index 8ab8039..401c034 100644 --- a/gui/graphwidget.cpp +++ b/gui/graphwidget.cpp @@ -401,10 +401,16 @@ void GraphWidget::paintEvent(QPaintEvent *e) paintHorizontalAxis(painter); paintVerticalAxis(painter); - /* Cover up any overdraw in top left corner */ + /* Draw the label */ painter.resetTransform(); painter.fillRect(0, 0, m_axisWidth - 1, m_axisHeight - 1, Qt::lightGray); + if (m_type == GraphGpu) { + painter.drawText(0, 0, m_axisWidth, m_axisHeight, Qt::AlignHCenter | Qt::AlignVCenter, "GPU"); + } else { + painter.drawText(0, 0, m_axisWidth, m_axisHeight, Qt::AlignHCenter | Qt::AlignVCenter, "CPU"); + } + /* Draw graph */ if (m_type == GraphGpu) { brush = QBrush(m_graphGradientGpu);