diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-05-27 09:16:08 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-05-27 09:16:08 (GMT) |
commit | 7184c41453c64f177f337b173f4ca82afead731d (patch) | |
tree | d723fdf36be89b57602961491311962e16985b03 /src | |
parent | b0f03285862041141817f3d733c54d89ce3979d8 (diff) | |
download | Qt-7184c41453c64f177f337b173f4ca82afead731d.zip Qt-7184c41453c64f177f337b173f4ca82afead731d.tar.gz Qt-7184c41453c64f177f337b173f4ca82afead731d.tar.bz2 |
Rename QDeclarativeDebugTiming -> QDeclarativeDebugTrace
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/debugger.pri | 4 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativedebugtrace.cpp (renamed from src/declarative/debugger/qdeclarativedebugtiming.cpp) | 39 | ||||
-rw-r--r-- | src/declarative/debugger/qdeclarativedebugtrace_p.h (renamed from src/declarative/debugger/qdeclarativedebugtiming_p.h) | 15 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent.cpp | 7 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeview.cpp | 18 |
5 files changed, 52 insertions, 31 deletions
diff --git a/src/declarative/debugger/debugger.pri b/src/declarative/debugger/debugger.pri index 6777868..33d0843 100644 --- a/src/declarative/debugger/debugger.pri +++ b/src/declarative/debugger/debugger.pri @@ -6,7 +6,7 @@ SOURCES += \ $$PWD/qdeclarativedebugservice.cpp \ $$PWD/qdeclarativedebugclient.cpp \ $$PWD/qdeclarativedebug.cpp \ - $$PWD/qdeclarativedebugtiming.cpp + $$PWD/qdeclarativedebugtrace.cpp HEADERS += \ $$PWD/qdeclarativedebuggerstatus_p.h \ @@ -14,4 +14,4 @@ HEADERS += \ $$PWD/qdeclarativedebugservice_p.h \ $$PWD/qdeclarativedebugclient_p.h \ $$PWD/qdeclarativedebug_p.h \ - $$PWD/qdeclarativedebugtiming_p.h + $$PWD/qdeclarativedebugtrace_p.h diff --git a/src/declarative/debugger/qdeclarativedebugtiming.cpp b/src/declarative/debugger/qdeclarativedebugtrace.cpp index 5b93852..5e6d5e7 100644 --- a/src/declarative/debugger/qdeclarativedebugtiming.cpp +++ b/src/declarative/debugger/qdeclarativedebugtrace.cpp @@ -39,37 +39,44 @@ ** ****************************************************************************/ -#include "qdeclarativedebugtiming_p.h" +#include "qdeclarativedebugtrace_p.h" #include <QtCore/qdatastream.h> +#include <QtCore/qurl.h> -Q_GLOBAL_STATIC(QDeclarativeDebugTiming, timerInstance); +Q_GLOBAL_STATIC(QDeclarativeDebugTrace, traceInstance); -QDeclarativeDebugTiming::QDeclarativeDebugTiming() +QDeclarativeDebugTrace::QDeclarativeDebugTrace() : QDeclarativeDebugService(QLatin1String("CanvasFrameRate")) { m_timer.start(); } -void QDeclarativeDebugTiming::addEvent(EventType t) +void QDeclarativeDebugTrace::addEvent(EventType t) { if (QDeclarativeDebugService::isDebuggingEnabled()) - timerInstance()->addEventImpl(t); + traceInstance()->addEventImpl(t); } -void QDeclarativeDebugTiming::startRange(RangeType t) +void QDeclarativeDebugTrace::startRange(RangeType t) { if (QDeclarativeDebugService::isDebuggingEnabled()) - timerInstance()->startRangeImpl(t); + traceInstance()->startRangeImpl(t); } -void QDeclarativeDebugTiming::endRange(RangeType t) +void QDeclarativeDebugTrace::rangeData(RangeType t, const QUrl &url) { if (QDeclarativeDebugService::isDebuggingEnabled()) - timerInstance()->endRangeImpl(t); + traceInstance()->rangeDataImpl(t, url); } -void QDeclarativeDebugTiming::addEventImpl(EventType event) +void QDeclarativeDebugTrace::endRange(RangeType t) +{ + if (QDeclarativeDebugService::isDebuggingEnabled()) + traceInstance()->endRangeImpl(t); +} + +void QDeclarativeDebugTrace::addEventImpl(EventType event) { QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); @@ -77,7 +84,7 @@ void QDeclarativeDebugTiming::addEventImpl(EventType event) sendMessage(data); } -void QDeclarativeDebugTiming::startRangeImpl(RangeType range) +void QDeclarativeDebugTrace::startRangeImpl(RangeType range) { QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); @@ -85,7 +92,15 @@ void QDeclarativeDebugTiming::startRangeImpl(RangeType range) sendMessage(data); } -void QDeclarativeDebugTiming::endRangeImpl(RangeType range) +void QDeclarativeDebugTrace::rangeDataImpl(RangeType range, const QUrl &u) +{ + QByteArray data; + QDataStream ds(&data, QIODevice::WriteOnly); + ds << m_timer.elapsed() << (int)RangeData << (int)range << (QString)u.toString(); + sendMessage(data); +} + +void QDeclarativeDebugTrace::endRangeImpl(RangeType range) { QByteArray data; QDataStream ds(&data, QIODevice::WriteOnly); diff --git a/src/declarative/debugger/qdeclarativedebugtiming_p.h b/src/declarative/debugger/qdeclarativedebugtrace_p.h index d9ed67c..5ba49a8 100644 --- a/src/declarative/debugger/qdeclarativedebugtiming_p.h +++ b/src/declarative/debugger/qdeclarativedebugtrace_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEDEBUGTIMING_P_H -#define QDECLARATIVEDEBUGTIMING_P_H +#ifndef QDECLARATIVEDEBUGTRACE_P_H +#define QDECLARATIVEDEBUGTRACE_P_H #include <private/qdeclarativedebugservice_p.h> #include <QtCore/qelapsedtimer.h> @@ -49,7 +49,8 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QDeclarativeDebugTiming : public QDeclarativeDebugService +class QUrl; +class QDeclarativeDebugTrace : public QDeclarativeDebugService { public: enum EventType { @@ -63,6 +64,7 @@ public: enum Message { Event, RangeStart, + RangeData, RangeEnd, MaximumMessage @@ -77,13 +79,16 @@ public: }; static void addEvent(EventType); + static void startRange(RangeType); + static void rangeData(RangeType, const QUrl &); static void endRange(RangeType); - QDeclarativeDebugTiming(); + QDeclarativeDebugTrace(); private: void addEventImpl(EventType); void startRangeImpl(RangeType); + void rangeDataImpl(RangeType, const QUrl &); void endRangeImpl(RangeType); QElapsedTimer m_timer; }; @@ -92,5 +97,5 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEDEBUGTIMING_P_H +#endif // QDECLARATIVEDEBUGTRACE_P_H diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 2dc2d2d..9847079 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -53,7 +53,7 @@ #include "private/qdeclarativebinding_p_p.h" #include "private/qdeclarativeglobal_p.h" #include "private/qdeclarativescriptparser_p.h" -#include "private/qdeclarativedebugtiming_p.h" +#include "private/qdeclarativedebugtrace_p.h" #include <QStack> #include <QStringList> @@ -696,7 +696,8 @@ QDeclarativeComponentPrivate::beginCreate(QDeclarativeContextData *context, cons bool isRoot = !ep->inBeginCreate; if (isRoot) - QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Creating); + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Creating); + QDeclarativeDebugTrace::rangeData(QDeclarativeDebugTrace::Creating, cc->url); QDeclarativeContextData *ctxt = new QDeclarativeContextData; ctxt->isInternal = true; @@ -867,7 +868,7 @@ void QDeclarativeComponentPrivate::completeCreate() QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine); complete(ep, &state); - QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Creating); + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Creating); } } diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index d2dab76..6059ad6 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -48,7 +48,7 @@ #include <qdeclarativeglobal_p.h> #include <qdeclarativeguard_p.h> -#include <private/qdeclarativedebugtiming_p.h> +#include <private/qdeclarativedebugtrace_p.h> #include <qscriptvalueiterator.h> #include <qdebug.h> @@ -93,35 +93,35 @@ QDeclarativeScene::QDeclarativeScene() void QDeclarativeScene::keyPressEvent(QKeyEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Key); QGraphicsScene::keyPressEvent(e); } void QDeclarativeScene::keyReleaseEvent(QKeyEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Key); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Key); QGraphicsScene::keyReleaseEvent(e); } void QDeclarativeScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse); QGraphicsScene::mouseMoveEvent(e); } void QDeclarativeScene::mousePressEvent(QGraphicsSceneMouseEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse); QGraphicsScene::mousePressEvent(e); } void QDeclarativeScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) { - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::Mouse); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::Mouse); QGraphicsScene::mouseReleaseEvent(e); } @@ -675,8 +675,8 @@ void QDeclarativeView::paintEvent(QPaintEvent *event) { Q_D(QDeclarativeView); - QDeclarativeDebugTiming::addEvent(QDeclarativeDebugTiming::FramePaint); - QDeclarativeDebugTiming::startRange(QDeclarativeDebugTiming::Painting); + QDeclarativeDebugTrace::addEvent(QDeclarativeDebugTrace::FramePaint); + QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Painting); int time = 0; if (frameRateDebug()) @@ -684,7 +684,7 @@ void QDeclarativeView::paintEvent(QPaintEvent *event) QGraphicsView::paintEvent(event); - QDeclarativeDebugTiming::endRange(QDeclarativeDebugTiming::Painting); + QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Painting); if (frameRateDebug()) qDebug() << "paintEvent:" << d->frameTimer.elapsed() << "time since last frame:" << time; |