summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJosé Dapena Paz <jdapena@igalia.com>2014-06-13 18:48:49 +0200
committerDominik Holland <dominik.holland@qt.io>2020-06-11 09:14:32 +0200
commit6d323c0b221a3b127d80e338a42306cc34bc4d40 (patch)
treedc147872c6196404f2b90c6ef676a1717bcdf50f /src/gui
parentab6fd84c62ff4a72696798dcf6598dd6a44389f6 (diff)
Add more LTTNG tracing points
* QImage and QPixmap copy and transform operations. * OpenGL paint engine texture cache texture upload * OpenGL paint engine draw texture Task-number: QTBUG-83347 Pick-to: 5.15 Change-Id: I03150d6ff80cbbcd787133d75854715cb81b5571 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qimage.cpp15
-rw-r--r--src/gui/image/qpixmap.cpp8
-rw-r--r--src/gui/qtgui.tracepoints22
3 files changed, 45 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 1dc260246c..27969cabb6 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -73,6 +73,8 @@
#include "qthreadpool.h"
#endif
+#include <qtgui_tracepoints_p.h>
+
QT_BEGIN_NAMESPACE
static inline bool isLocked(QImageData *data)
@@ -127,6 +129,8 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format)
if (size.isEmpty() || format == QImage::Format_Invalid)
return nullptr; // invalid parameter(s)
+ Q_TRACE_SCOPE(QImageData_create, size, format);
+
int width = size.width();
int height = size.height();
int depth = qt_depthForFormat(format);
@@ -1166,6 +1170,7 @@ static void copyMetadata(QImage *dst, const QImage &src)
*/
QImage QImage::copy(const QRect& r) const
{
+ Q_TRACE_SCOPE(QImage_copy, r);
if (!d)
return QImage();
@@ -2794,6 +2799,8 @@ QImage QImage::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Transf
if (newSize == size())
return *this;
+ Q_TRACE_SCOPE(QImage_scaled, s, aspectMode, mode);
+
QTransform wm = QTransform::fromScale((qreal)newSize.width() / width(), (qreal)newSize.height() / height());
QImage img = transformed(wm, mode);
return img;
@@ -2822,6 +2829,8 @@ QImage QImage::scaledToWidth(int w, Qt::TransformationMode mode) const
if (w <= 0)
return QImage();
+ Q_TRACE_SCOPE(QImage_scaledToWidth, w, mode);
+
qreal factor = (qreal) w / width();
QTransform wm = QTransform::fromScale(factor, factor);
return transformed(wm, mode);
@@ -2850,6 +2859,8 @@ QImage QImage::scaledToHeight(int h, Qt::TransformationMode mode) const
if (h <= 0)
return QImage();
+ Q_TRACE_SCOPE(QImage_scaledToHeight, h, mode);
+
qreal factor = (qreal) h / height();
QTransform wm = QTransform::fromScale(factor, factor);
return transformed(wm, mode);
@@ -3304,6 +3315,8 @@ QImage QImage::rgbSwapped_helper() const
if (isNull())
return *this;
+ Q_TRACE_SCOPE(QImage_rgbSwapped_helper);
+
QImage res;
switch (d->format) {
@@ -4507,6 +4520,8 @@ QImage QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode
if (!d)
return QImage();
+ Q_TRACE_SCOPE(QImage_transformed, matrix, mode);
+
// source image data
int ws = width();
int hs = height();
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index bf20a9066b..3b9b98d58f 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -66,6 +66,8 @@
#include "qpixmap_raster_p.h"
#include "private/qhexstring_p.h"
+#include <qtgui_tracepoints_p.h>
+
QT_BEGIN_NAMESPACE
static bool qt_pixmap_thread_test()
@@ -1053,6 +1055,8 @@ QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Tran
if (newSize == size())
return *this;
+ Q_TRACE_SCOPE(QPixmap_scaled, s, aspectMode, mode);
+
QTransform wm = QTransform::fromScale((qreal)newSize.width() / width(),
(qreal)newSize.height() / height());
QPixmap pix = transformed(wm, mode);
@@ -1082,6 +1086,8 @@ QPixmap QPixmap::scaledToWidth(int w, Qt::TransformationMode mode) const
if (w <= 0)
return QPixmap();
+ Q_TRACE_SCOPE(QPixmap_scaledToWidth, w, mode);
+
qreal factor = (qreal) w / width();
QTransform wm = QTransform::fromScale(factor, factor);
return transformed(wm, mode);
@@ -1110,6 +1116,8 @@ QPixmap QPixmap::scaledToHeight(int h, Qt::TransformationMode mode) const
if (h <= 0)
return QPixmap();
+ Q_TRACE_SCOPE(QPixmap_scaledToHeight, h, mode);
+
qreal factor = (qreal) h / height();
QTransform wm = QTransform::fromScale(factor, factor);
return transformed(wm, mode);
diff --git a/src/gui/qtgui.tracepoints b/src/gui/qtgui.tracepoints
index 52916a3aa2..2b09c6a1e2 100644
--- a/src/gui/qtgui.tracepoints
+++ b/src/gui/qtgui.tracepoints
@@ -15,5 +15,27 @@ QFontDatabase_load(const QString &family, int pointSize)
QFontDatabase_loadEngine(const QString &family, int pointSize)
QFontDatabasePrivate_addAppFont(const QString &fileName)
+QImageData_create_entry(const QSize &size, QImage::Format format)
+QImageData_create_exit()
+QImage_copy_entry(const QRect& r)
+QImage_copy_exit()
+QImage_scaled_entry(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)
+QImage_scaled_exit()
+QImage_scaledToWidth_entry(int w, Qt::TransformationMode mode)
+QImage_scaledToWidth_exit()
+QImage_scaledToHeight_entry(int h, Qt::TransformationMode mode)
+QImage_scaledToHeight_exit()
+QImage_rgbSwapped_helper_entry()
+QImage_rgbSwapped_helper_exit()
+QImage_transformed_entry(const QTransform &matrix, Qt::TransformationMode mode )
+QImage_transformed_exit()
+
+QPixmap_scaled_entry(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode)
+QPixmap_scaled_exit()
+QPixmap_scaledToWidth_entry(int w, Qt::TransformationMode mode)
+QPixmap_scaledToWidth_exit()
+QPixmap_scaledToHeight_entry(int h, Qt::TransformationMode mode)
+QPixmap_scaledToHeight_exit()
+
QImageReader_read_before_reading(QImageReader *reader, const QString &filename)
QImageReader_read_after_reading(QImageReader *reader, bool result)