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 CCHeadsUpDisplayLayerImpl_h | 5 // Temporary forwarding header |
6 #define CCHeadsUpDisplayLayerImpl_h | 6 #include "cc/heads_up_display_layer_impl.h" |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "CCFontAtlas.h" | |
10 #include "CCLayerImpl.h" | |
11 #include "CCScopedTexture.h" | |
12 | |
13 class SkCanvas; | |
14 | |
15 namespace cc { | |
16 | |
17 class CCDebugRectHistory; | |
18 class CCFontAtlas; | |
19 class CCFrameRateCounter; | |
20 | |
21 class CCHeadsUpDisplayLayerImpl : public CCLayerImpl { | |
22 public: | |
23 static scoped_ptr<CCHeadsUpDisplayLayerImpl> create(int id) | |
24 { | |
25 return make_scoped_ptr(new CCHeadsUpDisplayLayerImpl(id)); | |
26 } | |
27 virtual ~CCHeadsUpDisplayLayerImpl(); | |
28 | |
29 void setFontAtlas(scoped_ptr<CCFontAtlas>); | |
30 | |
31 virtual void willDraw(CCResourceProvider*) OVERRIDE; | |
32 virtual void appendQuads(CCQuadSink&, CCAppendQuadsData&) OVERRIDE; | |
33 void updateHudTexture(CCResourceProvider*); | |
34 virtual void didDraw(CCResourceProvider*) OVERRIDE; | |
35 | |
36 virtual void didLoseContext() OVERRIDE; | |
37 | |
38 virtual bool layerIsAlwaysDamaged() const OVERRIDE; | |
39 | |
40 private: | |
41 explicit CCHeadsUpDisplayLayerImpl(int); | |
42 | |
43 virtual const char* layerTypeAsString() const OVERRIDE; | |
44 | |
45 void drawHudContents(SkCanvas*); | |
46 void drawFPSCounter(SkCanvas*, CCFrameRateCounter*, int top, int height); | |
47 void drawFPSCounterText(SkCanvas*, CCFrameRateCounter*, int top, int width,
int height); | |
48 void drawDebugRects(SkCanvas*, CCDebugRectHistory*); | |
49 | |
50 scoped_ptr<CCFontAtlas> m_fontAtlas; | |
51 OwnPtr<CCScopedTexture> m_hudTexture; | |
52 OwnPtr<SkCanvas> m_hudCanvas; | |
53 }; | |
54 | |
55 } // namespace cc | |
56 | |
57 #endif // CCHeadsUpDisplayLayerImpl_h | |
OLD | NEW |