Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: cc/heads_up_display_layer_impl.h

Issue 11472021: cc: Pass LayerTreeHostImpl to LayerImpl constructor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/heads_up_display_layer.cc ('k') | cc/heads_up_display_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 11 #include "cc/font_atlas.h"
12 #include "cc/layer_impl.h" 12 #include "cc/layer_impl.h"
13 #include "cc/scoped_resource.h" 13 #include "cc/scoped_resource.h"
14 14
15 class SkCanvas; 15 class SkCanvas;
16 class SkPaint; 16 class SkPaint;
17 struct SkRect; 17 struct SkRect;
18 18
19 namespace cc { 19 namespace cc {
20 20
21 class DebugRectHistory; 21 class DebugRectHistory;
22 class FontAtlas; 22 class FontAtlas;
23 class FrameRateCounter; 23 class FrameRateCounter;
24 24
25 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { 25 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
26 public: 26 public:
27 static scoped_ptr<HeadsUpDisplayLayerImpl> create(int id) 27 static scoped_ptr<HeadsUpDisplayLayerImpl> create(LayerTreeHostImpl* hostImp l, int id)
28 { 28 {
29 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(id)); 29 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(hostImpl, id));
30 } 30 }
31 virtual ~HeadsUpDisplayLayerImpl(); 31 virtual ~HeadsUpDisplayLayerImpl();
32 32
33 void setFontAtlas(scoped_ptr<FontAtlas>); 33 void setFontAtlas(scoped_ptr<FontAtlas>);
34 34
35 virtual void willDraw(ResourceProvider*) OVERRIDE; 35 virtual void willDraw(ResourceProvider*) OVERRIDE;
36 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; 36 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE;
37 void updateHudTexture(ResourceProvider*); 37 void updateHudTexture(ResourceProvider*);
38 virtual void didDraw(ResourceProvider*) OVERRIDE; 38 virtual void didDraw(ResourceProvider*) OVERRIDE;
39 39
40 virtual void didLoseOutputSurface() OVERRIDE; 40 virtual void didLoseOutputSurface() OVERRIDE;
41 41
42 virtual bool layerIsAlwaysDamaged() const OVERRIDE; 42 virtual bool layerIsAlwaysDamaged() const OVERRIDE;
43 43
44 private: 44 private:
45 explicit HeadsUpDisplayLayerImpl(int); 45 HeadsUpDisplayLayerImpl(LayerTreeHostImpl* hostImpl, int id);
46 46
47 virtual const char* layerTypeAsString() const OVERRIDE; 47 virtual const char* layerTypeAsString() const OVERRIDE;
48 48
49 void drawHudContents(SkCanvas*); 49 void drawHudContents(SkCanvas*);
50 int drawFPSCounter(SkCanvas*, FrameRateCounter*); 50 int drawFPSCounter(SkCanvas*, FrameRateCounter*);
51 void drawFPSCounterText(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect); 51 void drawFPSCounterText(SkCanvas*, SkPaint&, FrameRateCounter*, SkRect);
52 void drawFPSCounterGraphAndHistogram(SkCanvas* canvas, SkPaint& paint, Frame RateCounter* fpsCounter, SkRect graphBounds, SkRect histogramBounds); 52 void drawFPSCounterGraphAndHistogram(SkCanvas* canvas, SkPaint& paint, Frame RateCounter* fpsCounter, SkRect graphBounds, SkRect histogramBounds);
53 void drawDebugRects(SkCanvas*, DebugRectHistory*); 53 void drawDebugRects(SkCanvas*, DebugRectHistory*);
54 54
55 scoped_ptr<FontAtlas> m_fontAtlas; 55 scoped_ptr<FontAtlas> m_fontAtlas;
56 scoped_ptr<ScopedResource> m_hudTexture; 56 scoped_ptr<ScopedResource> m_hudTexture;
57 scoped_ptr<SkCanvas> m_hudCanvas; 57 scoped_ptr<SkCanvas> m_hudCanvas;
58 58
59 double m_averageFPS; 59 double m_averageFPS;
60 double m_minFPS; 60 double m_minFPS;
61 double m_maxFPS; 61 double m_maxFPS;
62 62
63 base::TimeTicks textUpdateTime; 63 base::TimeTicks textUpdateTime;
64 }; 64 };
65 65
66 } // namespace cc 66 } // namespace cc
67 67
68 #endif // CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ 68 #endif // CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/heads_up_display_layer.cc ('k') | cc/heads_up_display_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698