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>
This commit is contained in:
parent
ab6fd84c62
commit
6d323c0b22
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -152,3 +152,6 @@ qtConfig(egl) {
|
||||
}
|
||||
|
||||
load(qt_module)
|
||||
|
||||
TRACEPOINT_PROVIDER = $$PWD/qtopengl.tracepoints
|
||||
CONFIG += qt_tracepoints
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
3
src/opengl/qtopengl.tracepoints
Normal file
3
src/opengl/qtopengl.tracepoints
Normal file
@ -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)
|
Loading…
Reference in New Issue
Block a user