From 9bdf74a4f23d009777f1cbdb0078aa70060a3da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Mon, 19 Sep 2022 08:23:13 +0300 Subject: Add tracepointgen tool and convert qtgui to use it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows automatically generating tracepoint files by scanning source files for instrumentation macros. This makes it easier to add tracepoint support to modules and also ensures that the tracepoint files do not get out of sync with the functions they are tracing. Q_TRACE_INSTRUMENT generates entry/exit tracespoints for a function it is set. Q_TRACE_PARAM_REPLACE is used to change a function parameter for these functions to convert it to supported parameter type. Q_TRACE_POINT can be used to create a standalone tracepoint. Q_TRACE_PREFIX can be used to add prefix for generated tracing backend for example to add includes for types used in the trace points.. Task-number: QTBUG-107238 Pick-to: 6.5 Change-Id: Ib395b80838434ceb72683dac0545ca20c4d09455 Reviewed-by: Tomi Korpipää --- src/gui/image/qpixmap.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gui/image/qpixmap.cpp') diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 8e98a4f254..8b7de7ac23 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -38,6 +38,9 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; +Q_TRACE_PARAM_REPLACE(Qt::AspectRatioMode, int); +Q_TRACE_PARAM_REPLACE(Qt::TransformationMode, int); + // MSVC 19.28 does show spurious warning "C4723: potential divide by 0" for code that divides // by height() in release builds. Anyhow, all the code paths in this file are only executed // for valid QPixmap's, where height() cannot be 0. Therefore disable the warning. @@ -1032,7 +1035,7 @@ bool QPixmap::convertFromImage(const QImage &image, Qt::ImageConversionFlags fla Transformations} */ -QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode) const +QPixmap Q_TRACE_INSTRUMENT(qtgui) QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::TransformationMode mode) const { if (isNull()) { qWarning("QPixmap::scaled: Pixmap is a null pixmap"); @@ -1070,7 +1073,7 @@ QPixmap QPixmap::scaled(const QSize& s, Qt::AspectRatioMode aspectMode, Qt::Tran \sa isNull(), {QPixmap#Pixmap Transformations}{Pixmap Transformations} */ -QPixmap QPixmap::scaledToWidth(int w, Qt::TransformationMode mode) const +QPixmap Q_TRACE_INSTRUMENT(qtgui) QPixmap::scaledToWidth(int w, Qt::TransformationMode mode) const { if (isNull()) { qWarning("QPixmap::scaleWidth: Pixmap is a null pixmap"); @@ -1100,7 +1103,7 @@ QPixmap QPixmap::scaledToWidth(int w, Qt::TransformationMode mode) const \sa isNull(), {QPixmap#Pixmap Transformations}{Pixmap Transformations} */ -QPixmap QPixmap::scaledToHeight(int h, Qt::TransformationMode mode) const +QPixmap Q_TRACE_INSTRUMENT(qtgui) QPixmap::scaledToHeight(int h, Qt::TransformationMode mode) const { if (isNull()) { qWarning("QPixmap::scaleHeight: Pixmap is a null pixmap"); -- cgit v1.2.3