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 CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
6 #define CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 6 #define CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 int id) { | 32 int id) { |
33 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(tree_impl, id)); | 33 return make_scoped_ptr(new HeadsUpDisplayLayerImpl(tree_impl, id)); |
34 } | 34 } |
35 virtual ~HeadsUpDisplayLayerImpl(); | 35 virtual ~HeadsUpDisplayLayerImpl(); |
36 | 36 |
37 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 37 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
38 OVERRIDE; | 38 OVERRIDE; |
39 | 39 |
40 virtual bool WillDraw(DrawMode draw_mode, | 40 virtual bool WillDraw(DrawMode draw_mode, |
41 ResourceProvider* resource_provider) OVERRIDE; | 41 ResourceProvider* resource_provider) OVERRIDE; |
42 virtual void AppendQuads(QuadSink* quad_sink, | 42 virtual void AppendQuads(RenderPass* render_pass, |
| 43 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
43 AppendQuadsData* append_quads_data) OVERRIDE; | 44 AppendQuadsData* append_quads_data) OVERRIDE; |
44 void UpdateHudTexture(DrawMode draw_mode, | 45 void UpdateHudTexture(DrawMode draw_mode, |
45 ResourceProvider* resource_provider); | 46 ResourceProvider* resource_provider); |
46 | 47 |
47 virtual void ReleaseResources() OVERRIDE; | 48 virtual void ReleaseResources() OVERRIDE; |
48 | 49 |
49 bool IsAnimatingHUDContents() const { return fade_step_ > 0; } | 50 bool IsAnimatingHUDContents() const { return fade_step_ > 0; } |
50 | 51 |
51 private: | 52 private: |
52 class Graph { | 53 class Graph { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 int top) const; | 104 int top) const; |
104 SkRect DrawMemoryDisplay(SkCanvas* canvas, | 105 SkRect DrawMemoryDisplay(SkCanvas* canvas, |
105 int top, | 106 int top, |
106 int right, | 107 int right, |
107 int width) const; | 108 int width) const; |
108 SkRect DrawPaintTimeDisplay(SkCanvas* canvas, | 109 SkRect DrawPaintTimeDisplay(SkCanvas* canvas, |
109 const PaintTimeCounter* paint_time_counter, | 110 const PaintTimeCounter* paint_time_counter, |
110 int top, | 111 int top, |
111 int right) const; | 112 int right) const; |
112 void DrawDebugRect(SkCanvas* canvas, | 113 void DrawDebugRect(SkCanvas* canvas, |
113 SkPaint& paint, | 114 SkPaint* paint, |
114 const DebugRect& rect, | 115 const DebugRect& rect, |
115 SkColor stroke_color, | 116 SkColor stroke_color, |
116 SkColor fill_color, | 117 SkColor fill_color, |
117 float stroke_width, | 118 float stroke_width, |
118 const std::string& label_text) const; | 119 const std::string& label_text) const; |
119 void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history); | 120 void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history); |
120 | 121 |
121 scoped_ptr<ScopedResource> hud_resource_; | 122 scoped_ptr<ScopedResource> hud_resource_; |
122 scoped_ptr<SkCanvas> hud_canvas_; | 123 scoped_ptr<SkCanvas> hud_canvas_; |
123 | 124 |
124 skia::RefPtr<SkTypeface> typeface_; | 125 skia::RefPtr<SkTypeface> typeface_; |
125 | 126 |
126 Graph fps_graph_; | 127 Graph fps_graph_; |
127 Graph paint_time_graph_; | 128 Graph paint_time_graph_; |
128 MemoryHistory::Entry memory_entry_; | 129 MemoryHistory::Entry memory_entry_; |
129 int fade_step_; | 130 int fade_step_; |
130 std::vector<DebugRect> paint_rects_; | 131 std::vector<DebugRect> paint_rects_; |
131 | 132 |
132 base::TimeTicks time_of_last_graph_update_; | 133 base::TimeTicks time_of_last_graph_update_; |
133 | 134 |
134 DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayerImpl); | 135 DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayerImpl); |
135 }; | 136 }; |
136 | 137 |
137 } // namespace cc | 138 } // namespace cc |
138 | 139 |
139 #endif // CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 140 #endif // CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
OLD | NEW |