diff options
author | Antti Määttä <[email protected]> | 2023-01-27 08:12:40 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2023-02-10 10:40:09 +0000 |
commit | ce2c12be413dd843f98e632b7db83d54bf0bf4e6 (patch) | |
tree | 6c5d39d5180cdc78119e7f7382dcca17f7ca8f55 | |
parent | 22dad3f83c61e34f45600af4b3b703dbe907cb67 (diff) |
Trace: Convert qtopengl module to use tracepointgen tool
Change-Id: I441455a4d49a559fb591ea5c8cffb97af66fb2b1
Reviewed-by: Hatem ElKharashy <[email protected]>
Reviewed-by: Tomi Korpipää <[email protected]>
Reviewed-by: Janne Koskinen <[email protected]>
(cherry picked from commit 4d359e2bec96507a1bc698525f4b5eda57b4a48f)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r-- | src/opengl/CMakeLists.txt | 8 | ||||
-rw-r--r-- | src/opengl/qopenglframebufferobject.cpp | 18 | ||||
-rw-r--r-- | src/opengl/qopenglpaintengine.cpp | 16 | ||||
-rw-r--r-- | src/opengl/qopengltexturecache.cpp | 3 |
4 files changed, 27 insertions, 18 deletions
diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 8aec1c685bb..3f5e34e9d0e 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -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 ) diff --git a/src/opengl/qopenglframebufferobject.cpp b/src/opengl/qopenglframebufferobject.cpp index 64b07e661fb..ccb4f7b0a86 100644 --- a/src/opengl/qopenglframebufferobject.cpp +++ b/src/opengl/qopenglframebufferobject.cpp @@ -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); diff --git a/src/opengl/qopenglpaintengine.cpp b/src/opengl/qopenglpaintengine.cpp index 8cdf08bdefe..062eaa6a530 100644 --- a/src/opengl/qopenglpaintengine.cpp +++ b/src/opengl/qopenglpaintengine.cpp @@ -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) -{ - Q_TRACE_SCOPE(QOpenGL2PaintEngineExPrivate_drawTexture, - dest.left, - dest.top, - dest.right, - dest.bottom, - src.left, - src.top, - src.right, - src.bottom, - textureSize, opaque); +void Q_TRACE_INSTRUMENT(qtopengl) QOpenGL2PaintEngineExPrivate::drawTexture(const QOpenGLRect& dest, const QOpenGLRect& src, const QSize &textureSize, bool opaque, bool pattern) +{ + Q_TRACE_PARAM_REPLACE(QOpenGLRect, QRectF); + 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 6d706325a5b..107380ff08c 100644 --- a/src/opengl/qopengltexturecache.cpp +++ b/src/opengl/qopengltexturecache.cpp @@ -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); |