blob: 69e550a4c02c6af37eca804389921e8a28eba2b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CCHeadsUpDisplayLayerImpl_h
#define CCHeadsUpDisplayLayerImpl_h
#include "CCFontAtlas.h"
#include "CCLayerImpl.h"
#include "base/memory/scoped_ptr.h"
#include "cc/scoped_texture.h"
class SkCanvas;
namespace cc {
class CCDebugRectHistory;
class CCFontAtlas;
class CCFrameRateCounter;
class CCHeadsUpDisplayLayerImpl : public CCLayerImpl {
public:
static scoped_ptr<CCHeadsUpDisplayLayerImpl> create(int id)
{
return make_scoped_ptr(new CCHeadsUpDisplayLayerImpl(id));
}
virtual ~CCHeadsUpDisplayLayerImpl();
void setFontAtlas(scoped_ptr<CCFontAtlas>);
virtual void willDraw(CCResourceProvider*) OVERRIDE;
virtual void appendQuads(CCQuadSink&, CCAppendQuadsData&) OVERRIDE;
void updateHudTexture(CCResourceProvider*);
virtual void didDraw(CCResourceProvider*) OVERRIDE;
virtual void didLoseContext() OVERRIDE;
virtual bool layerIsAlwaysDamaged() const OVERRIDE;
private:
explicit CCHeadsUpDisplayLayerImpl(int);
virtual const char* layerTypeAsString() const OVERRIDE;
void drawHudContents(SkCanvas*);
void drawFPSCounter(SkCanvas*, CCFrameRateCounter*, int top, int height);
void drawFPSCounterText(SkCanvas*, CCFrameRateCounter*, int top, int width, int height);
void drawDebugRects(SkCanvas*, CCDebugRectHistory*);
scoped_ptr<CCFontAtlas> m_fontAtlas;
scoped_ptr<CCScopedTexture> m_hudTexture;
scoped_ptr<SkCanvas> m_hudCanvas;
};
} // namespace cc
#endif // CCHeadsUpDisplayLayerImpl_h
|