tracegen: Add support for QSizeF and QRectF types
Change-Id: Ie19523b84026312c3d5a597914abc2622dba3f68 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> (cherry picked from commit 0510307ea1bfe2a1788738acb61890587e75dd5e)
This commit is contained in:
parent
b3f77d25aa
commit
c3af4a2180
@ -257,6 +257,18 @@ static void writeTracepoint(QTextStream &stream,
|
||||
stream << " + QStringLiteral(\"int32_t QSize_" << arg.name << "_height;\\n\\\n \")";
|
||||
eventSize += QStringLiteral("8");
|
||||
} break;
|
||||
case Tracepoint::Field::QtRectF: {
|
||||
stream << "QStringLiteral(\"float QRectF_" << arg.name << "_x;\\n\\\n \")";
|
||||
stream << " + QStringLiteral(\"float QRectF_" << arg.name << "_y;\\n\\\n \")";
|
||||
stream << " + QStringLiteral(\"float QRectF_" << arg.name << "_width;\\n\\\n \")";
|
||||
stream << " + QStringLiteral(\"float QRectF_" << arg.name << "_height;\\n\\\n \")";
|
||||
eventSize += QStringLiteral("16");
|
||||
} break;
|
||||
case Tracepoint::Field::QtSizeF: {
|
||||
stream << "QStringLiteral(\"float QSizeF_" << arg.name << "_width;\\n\\\n \")";
|
||||
stream << " + QStringLiteral(\"float QSizeF_" << arg.name << "_height;\\n\\\n \")";
|
||||
eventSize += QStringLiteral("8");
|
||||
} break;
|
||||
case Tracepoint::Field::Unknown:
|
||||
break;
|
||||
case Tracepoint::Field::EnumeratedType: {
|
||||
|
@ -45,12 +45,14 @@ static void writeEtwMacro(QTextStream &stream, const Tracepoint::Field &field)
|
||||
stream << "TraceLoggingValue(" << name << ".toEncoded().constData(), \"" << name << "\")";
|
||||
return;
|
||||
case Tracepoint::Field::QtRect:
|
||||
case Tracepoint::Field::QtRectF:
|
||||
stream << "TraceLoggingValue(" << name << ".x(), \"x\"), "
|
||||
<< "TraceLoggingValue(" << name << ".y(), \"y\"), "
|
||||
<< "TraceLoggingValue(" << name << ".width(), \"width\"), "
|
||||
<< "TraceLoggingValue(" << name << ".height(), \"height\")";
|
||||
return;
|
||||
case Tracepoint::Field::QtSize:
|
||||
case Tracepoint::Field::QtSizeF:
|
||||
stream << "TraceLoggingValue(" << name << ".width(), \"width\"), "
|
||||
<< "TraceLoggingValue(" << name << ".height(), \"height\")";
|
||||
return;
|
||||
|
@ -61,6 +61,16 @@ static void writeCtfMacro(QTextStream &stream, const Provider &provider, const T
|
||||
<< "ctf_integer(int, width, " << name << ".width()) "
|
||||
<< "ctf_integer(int, height, " << name << ".height()) ";
|
||||
return;
|
||||
case Tracepoint::Field::QtSizeF:
|
||||
stream << "ctf_float(int, width, " << name << ".width()) "
|
||||
<< "ctf_float(int, height, " << name << ".height()) ";
|
||||
return;
|
||||
case Tracepoint::Field::QtRectF:
|
||||
stream << "ctf_float(int, x, " << name << ".x()) "
|
||||
<< "ctf_float(int, y, " << name << ".y()) "
|
||||
<< "ctf_float(int, width, " << name << ".width()) "
|
||||
<< "ctf_float(int, height, " << name << ".height()) ";
|
||||
return;
|
||||
case Tracepoint::Field::QtSize:
|
||||
stream << "ctf_integer(int, width, " << name << ".width()) "
|
||||
<< "ctf_integer(int, height, " << name << ".height()) ";
|
||||
|
@ -140,7 +140,9 @@ static Tracepoint::Field::Type backendType(QString rawType)
|
||||
TYPEDATA_ENTRY(QByteArray, Tracepoint::Field::QtByteArray),
|
||||
TYPEDATA_ENTRY(QUrl, Tracepoint::Field::QtUrl),
|
||||
TYPEDATA_ENTRY(QRect, Tracepoint::Field::QtRect),
|
||||
TYPEDATA_ENTRY(QSize, Tracepoint::Field::QtSize)
|
||||
TYPEDATA_ENTRY(QSize, Tracepoint::Field::QtSize),
|
||||
TYPEDATA_ENTRY(QRectF, Tracepoint::Field::QtRectF),
|
||||
TYPEDATA_ENTRY(QSizeF, Tracepoint::Field::QtSizeF)
|
||||
};
|
||||
|
||||
auto backendType = [](const QString &rawType) {
|
||||
|
@ -33,6 +33,8 @@ struct Tracepoint
|
||||
QtUrl,
|
||||
QtRect,
|
||||
QtSize,
|
||||
QtRectF,
|
||||
QtSizeF,
|
||||
EnumeratedType,
|
||||
FlagType,
|
||||
Unknown
|
||||
|
Loading…
x
Reference in New Issue
Block a user