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

Side by Side Diff: cc/heads_up_display_layer_impl.h

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 years, 9 months 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/layer_impl.h" 11 #include "cc/layer_impl.h"
12 #include "cc/memory_history.h" 12 #include "cc/memory_history.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 class SkTypeface; 17 class SkTypeface;
18 struct SkRect; 18 struct SkRect;
19 19
20 namespace cc { 20 namespace cc {
21 21
22 class DebugRectHistory; 22 class DebugRectHistory;
23 class FrameRateCounter; 23 class FrameRateCounter;
24 class PaintTimeCounter; 24 class PaintTimeCounter;
25 25
26 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { 26 class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl {
27 public: 27 public:
28 static scoped_ptr<HeadsUpDisplayLayerImpl> create(LayerTreeImpl* treeImpl, i nt id) 28 static scoped_ptr<HeadsUpDisplayLayerImpl> Create(LayerTreeImpl* treeImpl, i nt id)
29 { 29 {
30 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(treeImpl, id)); 30 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(treeImpl, id));
31 } 31 }
32 virtual ~HeadsUpDisplayLayerImpl(); 32 virtual ~HeadsUpDisplayLayerImpl();
33 33
34 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR IDE; 34 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* treeImpl) OVERR IDE;
35 35
36 virtual void willDraw(ResourceProvider*) OVERRIDE; 36 virtual void WillDraw(ResourceProvider*) OVERRIDE;
37 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; 37 virtual void AppendQuads(QuadSink* quad_sink,
38 void updateHudTexture(ResourceProvider*); 38 AppendQuadsData* append_quads_data) OVERRIDE;
39 virtual void didDraw(ResourceProvider*) OVERRIDE; 39 void updateHudTexture(ResourceProvider* resource_provider);
40 virtual void DidDraw(ResourceProvider* resource_provider) OVERRIDE;
40 41
41 virtual void didLoseOutputSurface() OVERRIDE; 42 virtual void DidLoseOutputSurface() OVERRIDE;
42 43
43 virtual bool layerIsAlwaysDamaged() const OVERRIDE; 44 virtual bool LayerIsAlwaysDamaged() const OVERRIDE;
44 45
45 private: 46 private:
46 class Graph { 47 class Graph {
47 public: 48 public:
48 Graph(double indicatorValue, double startUpperBound); 49 Graph(double indicatorValue, double startUpperBound);
49 50
50 // Eases the upper bound, which limits what is currently visible in the graph, 51 // Eases the upper bound, which limits what is currently visible in the graph,
51 // so that the graph always scales to either it's max or defaultUpperBou nd. 52 // so that the graph always scales to either it's max or defaultUpperBou nd.
52 double updateUpperBound(); 53 double updateUpperBound();
53 54
54 double value; 55 double value;
55 double min; 56 double min;
56 double max; 57 double max;
57 58
58 double currentUpperBound; 59 double currentUpperBound;
59 const double defaultUpperBound; 60 const double defaultUpperBound;
60 const double indicator; 61 const double indicator;
61 }; 62 };
62 63
63 HeadsUpDisplayLayerImpl(LayerTreeImpl* treeImpl, int id); 64 HeadsUpDisplayLayerImpl(LayerTreeImpl* treeImpl, int id);
64 65
65 virtual const char* layerTypeAsString() const OVERRIDE; 66 virtual const char* LayerTypeAsString() const OVERRIDE;
66 67
67 void updateHudContents(); 68 void updateHudContents();
68 void drawHudContents(SkCanvas* canvas) const; 69 void drawHudContents(SkCanvas* canvas) const;
69 70
70 void drawText(SkCanvas* canvas, SkPaint* paint, const std::string& text, SkP aint::Align align, int size, int x, int y) const; 71 void drawText(SkCanvas* canvas, SkPaint* paint, const std::string& text, SkP aint::Align align, int size, int x, int y) const;
71 void drawText(SkCanvas* canvas, SkPaint* paint, const std::string& text, SkP aint::Align align, int size, const SkPoint& pos) const; 72 void drawText(SkCanvas* canvas, SkPaint* paint, const std::string& text, SkP aint::Align align, int size, const SkPoint& pos) const;
72 void drawGraphBackground(SkCanvas* canvas, SkPaint* paint, const SkRect& bou nds) const; 73 void drawGraphBackground(SkCanvas* canvas, SkPaint* paint, const SkRect& bou nds) const;
73 void drawGraphLines(SkCanvas* canvas, SkPaint* paint, const SkRect& bounds, const Graph& graph) const; 74 void drawGraphLines(SkCanvas* canvas, SkPaint* paint, const SkRect& bounds, const Graph& graph) const;
74 75
75 void drawPlatformLayerTree(SkCanvas* canvas) const; 76 void drawPlatformLayerTree(SkCanvas* canvas) const;
(...skipping 10 matching lines...) Expand all
86 Graph m_fpsGraph; 87 Graph m_fpsGraph;
87 Graph m_paintTimeGraph; 88 Graph m_paintTimeGraph;
88 MemoryHistory::Entry m_memoryEntry; 89 MemoryHistory::Entry m_memoryEntry;
89 90
90 base::TimeTicks m_timeOfLastGraphUpdate; 91 base::TimeTicks m_timeOfLastGraphUpdate;
91 }; 92 };
92 93
93 } // namespace cc 94 } // namespace cc
94 95
95 #endif // CC_HEADS_UP_DISPLAY_LAYER_IMPL_H_ 96 #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