diff options
Diffstat (limited to 'cc/CCHeadsUpDisplayLayerImpl.h')
-rw-r--r-- | cc/CCHeadsUpDisplayLayerImpl.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/cc/CCHeadsUpDisplayLayerImpl.h b/cc/CCHeadsUpDisplayLayerImpl.h new file mode 100644 index 0000000..6ad825a --- /dev/null +++ b/cc/CCHeadsUpDisplayLayerImpl.h @@ -0,0 +1,56 @@ +// 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 "CCScopedTexture.h" + +class SkCanvas; + +namespace WebCore { + +class CCDebugRectHistory; +class CCFontAtlas; +class CCFrameRateCounter; + +class CCHeadsUpDisplayLayerImpl : public CCLayerImpl { +public: + static PassOwnPtr<CCHeadsUpDisplayLayerImpl> create(int id) + { + return adoptPtr(new CCHeadsUpDisplayLayerImpl(id)); + } + virtual ~CCHeadsUpDisplayLayerImpl(); + + void setFontAtlas(PassOwnPtr<CCFontAtlas>); + + virtual void willDraw(CCResourceProvider*) OVERRIDE; + virtual void appendQuads(CCQuadSink&, bool& hadMissingTiles) OVERRIDE; + void updateHudTexture(CCResourceProvider*); + virtual void didDraw(CCResourceProvider*) OVERRIDE; + + virtual void didLoseContext() OVERRIDE; + + virtual bool layerIsAlwaysDamaged() const OVERRIDE { return true; } + +private: + explicit CCHeadsUpDisplayLayerImpl(int); + + virtual const char* layerTypeAsString() const OVERRIDE { return "HeadsUpDisplayLayer"; } + + 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*); + + OwnPtr<CCFontAtlas> m_fontAtlas; + OwnPtr<CCScopedTexture> m_hudTexture; + OwnPtr<SkCanvas> m_hudCanvas; +}; + +} + +#endif // CCHeadsUpDisplayLayerImpl_h |