#include <kis_fps_decoration.h>
|
| static const QString | idTag = "fps_decoration" |
| |
|
| bool | draw (const QString &text, QSize &outSize) |
| |
| QString | getText () const |
| |
Definition at line 18 of file kis_fps_decoration.h.
◆ KisFpsDecoration()
◆ ~KisFpsDecoration()
| KisFpsDecoration::~KisFpsDecoration |
( |
| ) |
|
|
override |
◆ draw()
| bool KisFpsDecoration::draw |
( |
const QString & | text, |
|
|
QSize & | outSize ) |
|
private |
Definition at line 76 of file kis_fps_decoration.cpp.
77{
79
80 const int flags = Qt::AlignLeft | Qt::AlignTop | Qt::TextDontClip;
82
85
86 painter.setPen(QPen(QColor(0xF0, 0xF0, 0xF0)));
87 painter.drawText(
m_pixmap.rect().translated(1, 1), flags, text, &
bounds);
88
89 outSize =
bounds.size() + QSize(1, 1);
90
91 if (
m_pixmap.width() < outSize.width() ||
m_pixmap.height() != outSize.height()) {
92 return false;
93 }
94
95 return true;
96}
References bounds, m_font, and m_pixmap.
◆ drawDecoration()
Implements KisCanvasDecoration.
Definition at line 42 of file kis_fps_decoration.cpp.
43{
44
45
46
47
49
50
51
52
53
54
55
56
58
59 if (!
draw(text, size)) {
60
61
62
63
65
67 }
68
71
73 m_scene->render(&gc,
r.translated(20, 20), r);
74}
bool draw(const QString &text, QSize &outSize)
int size(const Forest< T > &forest)
References draw(), getText(), KIS_ASSERT, m_pixmap, m_pixmapItem, m_scene, and m_shadow.
◆ getText()
| QString KisFpsDecoration::getText |
( |
| ) |
const |
|
private |
Definition at line 98 of file kis_fps_decoration.cpp.
99{
101
104 lines << QString(
"Canvas FPS: %1").arg(QString::number(
value,
'f', 1));
105 }
106
108
110 lines << QString("Last cursor/brush speed (px/ms): %1/%2%3")
114 lines << QString("Last brush framerate: %1 fps")
115 .arg(monitor->
lastFps(), 0,
'f', 1);
116
117 lines << QString("Average cursor/brush speed (px/ms): %1/%2")
120 lines << QString("Average brush framerate: %1 fps")
121 .arg(monitor->
avgFps(), 0,
'f', 1);
122 }
123
124 return lines.join('\n');
125}
float value(const T *src, size_t ch)
static KisOpenglCanvasDebugger * instance()
bool haveStrokeSpeedMeasurement() const
static KisStrokeSpeedMonitor * instance()
References KisOpenglCanvasDebugger::accumulatedFps(), KisStrokeSpeedMonitor::avgCursorSpeed, KisStrokeSpeedMonitor::avgFps, KisStrokeSpeedMonitor::avgRenderingSpeed, KisStrokeSpeedMonitor::haveStrokeSpeedMeasurement(), KisOpenglCanvasDebugger::instance(), KisStrokeSpeedMonitor::instance(), KisStrokeSpeedMonitor::lastCursorSpeed, KisStrokeSpeedMonitor::lastFps, KisStrokeSpeedMonitor::lastRenderingSpeed, KisStrokeSpeedMonitor::lastStrokeSaturated, and value().
◆ idTag
| const QString KisFpsDecoration::idTag = "fps_decoration" |
|
static |
◆ m_font
| QFont KisFpsDecoration::m_font |
|
private |
◆ m_pixmap
| QPixmap KisFpsDecoration::m_pixmap |
|
private |
◆ m_pixmapItem
| QGraphicsPixmapItem* KisFpsDecoration::m_pixmapItem |
|
private |
◆ m_scene
| QGraphicsScene* KisFpsDecoration::m_scene |
|
private |
◆ m_shadow
| QGraphicsDropShadowEffect* KisFpsDecoration::m_shadow |
|
private |
The documentation for this class was generated from the following files: