Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: cc/heads_up_display_layer_impl.h

Issue 11272042: improvements of the FPS counter in the HUDLayer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CCHeadsUpDisplayLayerImpl_h 5 #ifndef CCHeadsUpDisplayLayerImpl_h
6 #define CCHeadsUpDisplayLayerImpl_h 6 #define CCHeadsUpDisplayLayerImpl_h
7 7
8 #include "CCFontAtlas.h" 8 #include "CCFontAtlas.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time.h"
10 #include "cc/layer_impl.h" 11 #include "cc/layer_impl.h"
11 #include "cc/scoped_texture.h" 12 #include "cc/scoped_texture.h"
12 13
13 class SkCanvas; 14 class SkCanvas;
15 class SkPaint;
16 class SkRect;
14 17
15 namespace cc { 18 namespace cc {
16 19
17 class DebugRectHistory; 20 class DebugRectHistory;
18 class FontAtlas; 21 class FontAtlas;
19 class FrameRateCounter; 22 class FrameRateCounter;
20 23
21 class HeadsUpDisplayLayerImpl : public LayerImpl { 24 class HeadsUpDisplayLayerImpl : public LayerImpl {
22 public: 25 public:
23 static scoped_ptr<HeadsUpDisplayLayerImpl> create(int id) 26 static scoped_ptr<HeadsUpDisplayLayerImpl> create(int id)
(...skipping 12 matching lines...) Expand all
36 virtual void didLoseContext() OVERRIDE; 39 virtual void didLoseContext() OVERRIDE;
37 40
38 virtual bool layerIsAlwaysDamaged() const OVERRIDE; 41 virtual bool layerIsAlwaysDamaged() const OVERRIDE;
39 42
40 private: 43 private:
41 explicit HeadsUpDisplayLayerImpl(int); 44 explicit HeadsUpDisplayLayerImpl(int);
42 45
43 virtual const char* layerTypeAsString() const OVERRIDE; 46 virtual const char* layerTypeAsString() const OVERRIDE;
44 47
45 void drawHudContents(SkCanvas*); 48 void drawHudContents(SkCanvas*);
46 void drawFPSCounter(SkCanvas*, FrameRateCounter*, int top, int height); 49 int drawFPSCounter(SkCanvas*, FrameRateCounter*);
47 void drawFPSCounterText(SkCanvas*, FrameRateCounter*, int top, int width, in t height); 50 void drawFPSCounterText(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect);
51 void drawFPSCounterGraph(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect);
48 void drawDebugRects(SkCanvas*, DebugRectHistory*); 52 void drawDebugRects(SkCanvas*, DebugRectHistory*);
49 53
50 scoped_ptr<FontAtlas> m_fontAtlas; 54 scoped_ptr<FontAtlas> m_fontAtlas;
51 scoped_ptr<ScopedTexture> m_hudTexture; 55 scoped_ptr<ScopedTexture> m_hudTexture;
52 scoped_ptr<SkCanvas> m_hudCanvas; 56 scoped_ptr<SkCanvas> m_hudCanvas;
57
58 double m_averageFPS;
59 double m_stdDeviation;
60
61 base::TimeTicks textUpdateTime;
53 }; 62 };
54 63
55 } // namespace cc 64 } // namespace cc
56 65
57 #endif // CCHeadsUpDisplayLayerImpl_h 66 #endif // CCHeadsUpDisplayLayerImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698