Bug 34450

Summary: [Qt] Enable a way to measure FPS in QGVLauncher
Product: WebKit Reporter: Noam Rosenthal <noam>
Component: WebKit QtAssignee: Noam Rosenthal <noam>
Status: RESOLVED FIXED    
Severity: Normal CC: ariya.hidayat, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Add a command line argument to enable crude FPS measurements in QGVLauncher
ariya.hidayat: review-
FPS counter: changed name to --show-fps, guard from div-by-0
none
FPS counter: changed name to --show-fps, guard from div-by-0 none

Description Noam Rosenthal 2010-02-01 14:33:47 PST
This is needed in order to measure improvements to CSS accelerated compositing and general improvements to QtWebkit graphics
Comment 1 Noam Rosenthal 2010-02-01 14:40:13 PST
Created attachment 47871 [details]
Add a command line argument to enable crude FPS measurements in QGVLauncher

This is required for measuring improvements in QtWebkit graphics and in CSS accelerated-compositing.
Comment 2 Ariya Hidayat 2010-02-01 16:15:39 PST
Comment on attachment 47871 [details]
Add a command line argument to enable crude FPS measurements in QGVLauncher

> +        , m_measureFps(QApplication::instance()->arguments().contains("--fps"))

Maybe --show-fps is a better name?

> +        QTime now = QTime::currentTime();
> +        int msecs = m_startTime.msecsTo(now);
> +        int totalMsecs = m_totalStartTime.msecsTo(now);
> +        int totalFps = m_numTotalPaints * 1000 / totalMsecs;
> +        int curFps = m_numPaintsSinceLastMeasure * 1000 / msecs;

Please guard against divide-by-zero (yes, that might happen accidently :)

r- for this minor issues. Otherwise, looks good.
Comment 3 Noam Rosenthal 2010-02-01 16:57:47 PST
Created attachment 47881 [details]
FPS counter: changed name to --show-fps, guard from div-by-0

ok - this should do it.
Comment 4 Noam Rosenthal 2010-02-01 16:58:58 PST
Created attachment 47882 [details]
FPS counter: changed name to --show-fps, guard from div-by-0

oops, re-uploading
Comment 5 Ariya Hidayat 2010-02-01 20:07:27 PST
LGTM! Good job :)
Comment 6 WebKit Commit Bot 2010-02-02 03:38:27 PST
Comment on attachment 47882 [details]
FPS counter: changed name to --show-fps, guard from div-by-0

Clearing flags on attachment: 47882

Committed r54222: <http://trac.webkit.org/changeset/54222>
Comment 7 WebKit Commit Bot 2010-02-02 03:38:33 PST
All reviewed patches have been landed.  Closing bug.