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 "base/time.h" |
10 #include "cc/cc_export.h" | 10 #include "cc/cc_export.h" |
11 #include "cc/font_atlas.h" | |
12 #include "cc/layer_impl.h" | 11 #include "cc/layer_impl.h" |
13 #include "cc/scoped_resource.h" | 12 #include "cc/scoped_resource.h" |
14 | 13 |
15 class SkCanvas; | 14 class SkCanvas; |
16 class SkPaint; | 15 class SkPaint; |
17 class SkTypeface; | 16 class SkTypeface; |
18 struct SkRect; | 17 struct SkRect; |
19 | 18 |
20 namespace cc { | 19 namespace cc { |
21 | 20 |
22 class DebugRectHistory; | 21 class DebugRectHistory; |
23 class FontAtlas; | |
24 class FrameRateCounter; | 22 class FrameRateCounter; |
25 class MemoryHistory; | 23 class MemoryHistory; |
26 class PaintTimeCounter; | 24 class PaintTimeCounter; |
27 | 25 |
28 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { | 26 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { |
29 public: | 27 public: |
30 static scoped_ptr<HeadsUpDisplayLayerImpl> create(LayerTreeImpl* treeImpl, i
nt id) | 28 static scoped_ptr<HeadsUpDisplayLayerImpl> create(LayerTreeImpl* treeImpl, i
nt id) |
31 { | 29 { |
32 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(treeImpl, id)); | 30 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(treeImpl, id)); |
33 } | 31 } |
34 virtual ~HeadsUpDisplayLayerImpl(); | 32 virtual ~HeadsUpDisplayLayerImpl(); |
35 | 33 |
36 void setFontAtlas(scoped_ptr<FontAtlas>); | |
37 | |
38 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; | 34 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; |
39 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; | |
40 | 35 |
41 virtual void willDraw(ResourceProvider*) OVERRIDE; | 36 virtual void willDraw(ResourceProvider*) OVERRIDE; |
42 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 37 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
43 void updateHudTexture(ResourceProvider*); | 38 void updateHudTexture(ResourceProvider*); |
44 virtual void didDraw(ResourceProvider*) OVERRIDE; | 39 virtual void didDraw(ResourceProvider*) OVERRIDE; |
45 | 40 |
46 virtual void didLoseOutputSurface() OVERRIDE; | 41 virtual void didLoseOutputSurface() OVERRIDE; |
47 | 42 |
48 virtual bool layerIsAlwaysDamaged() const OVERRIDE; | 43 virtual bool layerIsAlwaysDamaged() const OVERRIDE; |
49 | 44 |
(...skipping 25 matching lines...) Expand all Loading... |
75 void drawGraphBackground(SkCanvas*, SkPaint*, const SkRect& bounds); | 70 void drawGraphBackground(SkCanvas*, SkPaint*, const SkRect& bounds); |
76 void drawGraphLines(SkCanvas*, SkPaint*, const SkRect& bounds, const Graph&)
; | 71 void drawGraphLines(SkCanvas*, SkPaint*, const SkRect& bounds, const Graph&)
; |
77 | 72 |
78 void drawPlaformLayerTree(SkCanvas*); | 73 void drawPlaformLayerTree(SkCanvas*); |
79 int drawFPSDisplay(SkCanvas*, FrameRateCounter*, const int& top); | 74 int drawFPSDisplay(SkCanvas*, FrameRateCounter*, const int& top); |
80 int drawMemoryDisplay(SkCanvas*, MemoryHistory*, const int& top); | 75 int drawMemoryDisplay(SkCanvas*, MemoryHistory*, const int& top); |
81 int drawPaintTimeDisplay(SkCanvas*, PaintTimeCounter*, const int& top); | 76 int drawPaintTimeDisplay(SkCanvas*, PaintTimeCounter*, const int& top); |
82 | 77 |
83 void drawDebugRects(SkCanvas*, DebugRectHistory*); | 78 void drawDebugRects(SkCanvas*, DebugRectHistory*); |
84 | 79 |
85 scoped_ptr<FontAtlas> m_fontAtlas; | |
86 scoped_ptr<ScopedResource> m_hudTexture; | 80 scoped_ptr<ScopedResource> m_hudTexture; |
87 scoped_ptr<SkCanvas> m_hudCanvas; | 81 scoped_ptr<SkCanvas> m_hudCanvas; |
88 | 82 |
89 skia::RefPtr<SkTypeface> m_typeface; | 83 skia::RefPtr<SkTypeface> m_typeface; |
90 | 84 |
91 Graph m_fpsGraph; | 85 Graph m_fpsGraph; |
92 Graph m_paintTimeGraph; | 86 Graph m_paintTimeGraph; |
93 | 87 |
94 base::TimeTicks m_timeOfLastGraphUpdate; | 88 base::TimeTicks m_timeOfLastGraphUpdate; |
95 }; | 89 }; |
96 | 90 |
97 } // namespace cc | 91 } // namespace cc |
98 | 92 |
99 #endif // CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 93 #endif // CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
OLD | NEW |