Trace: Convert qtopengl module to use tracepointgen tool

Pick-to: 6.5
Change-Id: I441455a4d49a559fb591ea5c8cffb97af66fb2b1
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
This commit is contained in:
Antti Määttä 2023-01-27 08:12:40 +02:00
parent 4ce1c1d932
commit 4d359e2bec
4 changed files with 26 additions and 17 deletions

View File

@ -105,8 +105,12 @@ qt_internal_extend_target(OpenGL CONDITION QT_FEATURE_egl
qopenglcompositorbackingstore.cpp qopenglcompositorbackingstore_p.h
)
qt_internal_create_tracepoints(OpenGL qtopengl.tracepoints)
qt_internal_generate_tracepoints(OpenGL opengl
SOURCES
qopenglframebufferobject.cpp
qopenglpaintengine.cpp
qopengltexturecache.cpp
)
qt_internal_add_docs(OpenGL
doc/qtopengl.qdocconf
)

View File

@ -18,6 +18,15 @@
QT_BEGIN_NAMESPACE
Q_TRACE_PREFIX(qtopengl,
"#include <private/qopengl2pexvertexarray_p.h>" \
"#include <private/qopengltextureuploader_p.h>" \
"#include <qopenglframebufferobject.h>"
);
Q_TRACE_PARAM_REPLACE(GLenum, int);
Q_TRACE_PARAM_REPLACE(GLint, int);
Q_TRACE_METADATA(qtopengl, "ENUM { } QOpenGLFramebufferObject::Attachment; ");
#ifndef QT_NO_DEBUG
#define QT_RESET_GLERROR() \
{ \
@ -452,10 +461,11 @@ namespace
}
}
void QOpenGLFramebufferObjectPrivate::init(QOpenGLFramebufferObject *qfbo, const QSize &size,
QOpenGLFramebufferObject::Attachment attachment,
GLenum texture_target, GLenum internal_format,
GLint samples, bool mipmap)
void Q_TRACE_INSTRUMENT(qtopengl) 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);

View File

@ -606,18 +606,10 @@ static inline void setCoords(GLfloat *coords, const QOpenGLRect &rect)
coords[7] = rect.bottom;
}
void QOpenGL2PaintEngineExPrivate::drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
void Q_TRACE_INSTRUMENT(qtopengl) QOpenGL2PaintEngineExPrivate::drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern)
{
Q_TRACE_SCOPE(QOpenGL2PaintEngineExPrivate_drawTexture,
dest.left,
dest.top,
dest.right,
dest.bottom,
src.left,
src.top,
src.right,
src.bottom,
textureSize, opaque);
Q_TRACE_PARAM_REPLACE(QOpenGLRect, QRectF);
Q_TRACE_SCOPE(QOpenGL2PaintEngineExPrivate_drawTexture, dest, src, textureSize, opaque, pattern);
// Setup for texture drawing
currentBrush = noBrush;

View File

@ -121,6 +121,9 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i
return id;
}
Q_TRACE_POINT(qtopengl, QOpenGLTextureCache_bindTexture_entry, QOpenGLContext *context, qint64 key, const unsigned char *image, int options);
Q_TRACE_POINT(qtopengl, QOpenGLTextureCache_bindTexture_exit);
GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, const QImage &image, QOpenGLTextureUploader::BindOptions options)
{
Q_TRACE_SCOPE(QOpenGLTextureCache_bindTexture, context, key, image.bits(), options);