summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qimage.cpp15
-rw-r--r--src/gui/image/qpixmap.cpp8
-rw-r--r--src/gui/qtgui.tracepoints22
-rw-r--r--src/opengl/CMakeLists.txt3
-rw-r--r--src/opengl/opengl.pro3
-rw-r--r--src/opengl/qopenglframebufferobject.cpp7
-rw-r--r--src/opengl/qopenglpaintengine.cpp4
-rw-r--r--src/opengl/qopengltexturecache.cpp4
-rw-r--r--src/opengl/qtopengl.tracepoints3
9 files changed, 68 insertions, 1 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)
diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt
index 7fac433205..1d8544ab8e 100644
--- a/src/opengl/CMakeLists.txt
+++ b/src/opengl/CMakeLists.txt
@@ -98,6 +98,9 @@ qt_extend_target(OpenGL CONDITION QT_FEATURE_egl
qopenglcompositor.cpp qopenglcompositor_p.h
qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h
)
+
+
+qt_create_tracepoints(OpenGL qtopengl.tracepoints)
qt_add_docs(OpenGL
doc/qtopengl.qdocconf
)
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index f190616ca8..0dd3d33552 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -152,3 +152,6 @@ qtConfig(egl) {
}
load(qt_module)
+
+TRACEPOINT_PROVIDER = $$PWD/qtopengl.tracepoints
+CONFIG += qt_tracepoints
diff --git a/src/opengl/qopenglframebufferobject.cpp b/src/opengl/qopenglframebufferobject.cpp
index ba18647387..813c01b0a5 100644
--- a/src/opengl/qopenglframebufferobject.cpp
+++ b/src/opengl/qopenglframebufferobject.cpp
@@ -50,6 +50,8 @@
#include <qimage.h>
#include <QtCore/qbytearray.h>
+#include <qtopengl_tracepoints_p.h>
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DEBUG
@@ -467,11 +469,14 @@ namespace
}
}
-void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *, const QSize &size,
+void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *qfbo, const QSize &size,
QOpenGLFramebufferObject::Attachment attachment,
GLenum texture_target, GLenum internal_format,
GLint samples, bool mipmap)
{
+ Q_TRACE_SCOPE(QOpenGLFramebufferObjectPrivate_init, qfbo, size, attachment, texture_target, internal_format, samples, mipmap);
+ Q_UNUSED(qfbo);
+
QOpenGLContext *ctx = QOpenGLContext::currentContext();
funcs.initializeOpenGLFunctions();
diff --git a/src/opengl/qopenglpaintengine.cpp b/src/opengl/qopenglpaintengine.cpp
index d1e8cabf28..51d2a48682 100644
--- a/src/opengl/qopenglpaintengine.cpp
+++ b/src/opengl/qopenglpaintengine.cpp
@@ -87,6 +87,8 @@
#include <QDebug>
+#include <qtopengl_tracepoints_p.h>
+
#ifndef GL_KHR_blend_equation_advanced
#define GL_KHR_blend_equation_advanced 1
#define GL_MULTIPLY_KHR 0x9294
@@ -635,6 +637,8 @@ static inline void setCoords(GLfloat *coords, const QOpenGLRect &rect)
void QOpenGL2PaintEngineExPrivate::drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
{
+ Q_TRACE_SCOPE(QOpenGL2PaintEngineExPrivate_drawTexture, dest, src, textureSize, opaque, pattern);
+
// Setup for texture drawing
currentBrush = noBrush;
diff --git a/src/opengl/qopengltexturecache.cpp b/src/opengl/qopengltexturecache.cpp
index 5256c429e0..a58570dbc4 100644
--- a/src/opengl/qopengltexturecache.cpp
+++ b/src/opengl/qopengltexturecache.cpp
@@ -44,6 +44,8 @@
#include <private/qimagepixmapcleanuphooks_p.h>
#include <qpa/qplatformpixmap.h>
+#include <qtopengl_tracepoints_p.h>
+
QT_BEGIN_NAMESPACE
class QOpenGLTextureCacheWrapper
@@ -157,6 +159,8 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i
GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options)
{
+ Q_TRACE_SCOPE(QOpenGLTextureCache_bindTexture, context, key, image, options);
+
GLuint id;
QOpenGLFunctions *funcs = context->functions();
funcs->glGenTextures(1, &id);
diff --git a/src/opengl/qtopengl.tracepoints b/src/opengl/qtopengl.tracepoints
new file mode 100644
index 0000000000..3c3043d3d4
--- /dev/null
+++ b/src/opengl/qtopengl.tracepoints
@@ -0,0 +1,3 @@
+QOpenGLFramebufferObjectPrivate_init(QOpenGLFramebufferObject *qfbo, const QSize &size, QOpenGLFramebufferObject::Attachment attachment, GLenum texture_target, GLenum internal_format, GLint samples, bool mipmap)
+QOpenGL2PaintEngineExPrivate_drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
+QOpenGLTextureCache_bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options)