From af97816e82e643e37c69656f55b9cfd12ba72eec Mon Sep 17 00:00:00 2001 From: "egraether@chromium.org" Date: Mon, 5 Nov 2012 21:48:15 +0000 Subject: this change improves the following points of the FPS counter: -cleaner design: less colors, text arranged above the graph, deviation number right aligned -added transparency: FPS counter does not completely cover the webpage -less frequent number updates: makes the numbers easier to read -indicator line at 60fps comparison images: https://docs.google.com/folder/d/0B8Y78t3tjy1XZk1xdWx6VjN5aFE/edit Please download the patch and provide a screenshot from your system to test the layout. Review URL: https://chromiumcodereview.appspot.com/11272042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166041 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/heads_up_display_layer_impl.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cc/heads_up_display_layer_impl.h') diff --git a/cc/heads_up_display_layer_impl.h b/cc/heads_up_display_layer_impl.h index bcca767..3276293 100644 --- a/cc/heads_up_display_layer_impl.h +++ b/cc/heads_up_display_layer_impl.h @@ -6,12 +6,15 @@ #define CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ #include "base/memory/scoped_ptr.h" +#include "base/time.h" #include "cc/cc_export.h" #include "cc/font_atlas.h" #include "cc/layer_impl.h" #include "cc/scoped_texture.h" class SkCanvas; +class SkPaint; +struct SkRect; namespace cc { @@ -44,13 +47,19 @@ private: virtual const char* layerTypeAsString() const OVERRIDE; void drawHudContents(SkCanvas*); - void drawFPSCounter(SkCanvas*, FrameRateCounter*, int top, int height); - void drawFPSCounterText(SkCanvas*, FrameRateCounter*, int top, int width, int height); + int drawFPSCounter(SkCanvas*, FrameRateCounter*); + void drawFPSCounterText(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect); + void drawFPSCounterGraph(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect); void drawDebugRects(SkCanvas*, DebugRectHistory*); scoped_ptr m_fontAtlas; scoped_ptr m_hudTexture; scoped_ptr m_hudCanvas; + + double m_averageFPS; + double m_stdDeviation; + + base::TimeTicks textUpdateTime; }; } // namespace cc -- cgit v1.1