OLD | NEW |
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 CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 5 #ifndef CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
6 #define CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 6 #define CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time.h" |
9 #include "cc/cc_export.h" | 10 #include "cc/cc_export.h" |
10 #include "cc/font_atlas.h" | 11 #include "cc/font_atlas.h" |
11 #include "cc/layer_impl.h" | 12 #include "cc/layer_impl.h" |
12 #include "cc/scoped_texture.h" | 13 #include "cc/scoped_texture.h" |
13 | 14 |
14 class SkCanvas; | 15 class SkCanvas; |
| 16 class SkPaint; |
| 17 struct SkRect; |
15 | 18 |
16 namespace cc { | 19 namespace cc { |
17 | 20 |
18 class DebugRectHistory; | 21 class DebugRectHistory; |
19 class FontAtlas; | 22 class FontAtlas; |
20 class FrameRateCounter; | 23 class FrameRateCounter; |
21 | 24 |
22 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { | 25 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { |
23 public: | 26 public: |
24 static scoped_ptr<HeadsUpDisplayLayerImpl> create(int id) | 27 static scoped_ptr<HeadsUpDisplayLayerImpl> create(int id) |
(...skipping 12 matching lines...) Expand all Loading... |
37 virtual void didLoseContext() OVERRIDE; | 40 virtual void didLoseContext() OVERRIDE; |
38 | 41 |
39 virtual bool layerIsAlwaysDamaged() const OVERRIDE; | 42 virtual bool layerIsAlwaysDamaged() const OVERRIDE; |
40 | 43 |
41 private: | 44 private: |
42 explicit HeadsUpDisplayLayerImpl(int); | 45 explicit HeadsUpDisplayLayerImpl(int); |
43 | 46 |
44 virtual const char* layerTypeAsString() const OVERRIDE; | 47 virtual const char* layerTypeAsString() const OVERRIDE; |
45 | 48 |
46 void drawHudContents(SkCanvas*); | 49 void drawHudContents(SkCanvas*); |
47 void drawFPSCounter(SkCanvas*, FrameRateCounter*, int top, int height); | 50 int drawFPSCounter(SkCanvas*, FrameRateCounter*); |
48 void drawFPSCounterText(SkCanvas*, FrameRateCounter*, int top, int width, in
t height); | 51 void drawFPSCounterText(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect); |
| 52 void drawFPSCounterGraph(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect); |
49 void drawDebugRects(SkCanvas*, DebugRectHistory*); | 53 void drawDebugRects(SkCanvas*, DebugRectHistory*); |
50 | 54 |
51 scoped_ptr<FontAtlas> m_fontAtlas; | 55 scoped_ptr<FontAtlas> m_fontAtlas; |
52 scoped_ptr<ScopedTexture> m_hudTexture; | 56 scoped_ptr<ScopedTexture> m_hudTexture; |
53 scoped_ptr<SkCanvas> m_hudCanvas; | 57 scoped_ptr<SkCanvas> m_hudCanvas; |
| 58 |
| 59 double m_averageFPS; |
| 60 double m_stdDeviation; |
| 61 |
| 62 base::TimeTicks textUpdateTime; |
54 }; | 63 }; |
55 | 64 |
56 } // namespace cc | 65 } // namespace cc |
57 | 66 |
58 #endif // CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 67 #endif // CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
OLD | NEW |