12013-02-06 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
2
3 [texmap] Implement frames-per-second debug counter
4 https://bugs.webkit.org/show_bug.cgi?id=107942
5
6 Reviewed by NOBODY (OOPS!).
7
8 Added TextureMapper' FPS counter via WEBKIT_SHOW_FPS=<interval> envvar,
9 where <interval> is the period (in seconds - i.e. WEBKIT_SHOW_FPS=1.0)
10 between FPS value udpates.
11
12 Visual debugging feature, no need to tests.
13
14 * platform/graphics/texmap/TextureMapperLayer.cpp:
15 (WebCore::TextureMapperLayer::paint): Paints FPS after all recursive layer paintings.
16 (WebCore::TextureMapperLayer::setShowFPS): Toggles FPS visible.
17 (WebCore::TextureMapperLayer::setFPS): Updates FPS value.
18 * platform/graphics/texmap/TextureMapperLayer.h:
19 (TextureMapperLayer): Added setters set{Show}FPS.
20 (State): Added 'fps' and 'showFPS'.
21 (WebCore::TextureMapperLayer::State::State): Added 'fps' and 'showFPS' to init list.
22 * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
23 (WebCore::CoordinatedGraphicsScene::CoordinatedGraphicsScene): Added envvar check code to trigger timer updates.
24 (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext): Increments paint count.
25 (WebCore::CoordinatedGraphicsScene::paintToGraphicsContext): Increments paint count.
26 (WebCore::CoordinatedGraphicsScene::fpsTimerFired): Updates FPS value to root layer.
27 * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h: Added FPS variables/timer functions.
28