| 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 ~HeadsUpDisplayLayerImpl() override; | 35 ~HeadsUpDisplayLayerImpl() override; |
| 36 | 36 |
| 37 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 37 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 38 | 38 |
| 39 bool WillDraw(DrawMode draw_mode, | 39 bool WillDraw(DrawMode draw_mode, |
| 40 ResourceProvider* resource_provider) override; | 40 ResourceProvider* resource_provider) override; |
| 41 void AppendQuads(RenderPass* render_pass, | 41 void AppendQuads(RenderPass* render_pass, |
| 42 const Occlusion& occlusion_in_content_space, | |
| 43 AppendQuadsData* append_quads_data) override; | 42 AppendQuadsData* append_quads_data) override; |
| 44 void UpdateHudTexture(DrawMode draw_mode, | 43 void UpdateHudTexture(DrawMode draw_mode, |
| 45 ResourceProvider* resource_provider); | 44 ResourceProvider* resource_provider); |
| 46 | 45 |
| 47 void ReleaseResources() override; | 46 void ReleaseResources() override; |
| 48 | 47 |
| 49 bool IsAnimatingHUDContents() const { return fade_step_ > 0; } | 48 bool IsAnimatingHUDContents() const { return fade_step_ > 0; } |
| 50 | 49 |
| 51 private: | 50 private: |
| 52 class Graph { | 51 class Graph { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 64 | 63 |
| 65 double current_upper_bound; | 64 double current_upper_bound; |
| 66 const double default_upper_bound; | 65 const double default_upper_bound; |
| 67 const double indicator; | 66 const double indicator; |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 HeadsUpDisplayLayerImpl(LayerTreeImpl* tree_impl, int id); | 69 HeadsUpDisplayLayerImpl(LayerTreeImpl* tree_impl, int id); |
| 71 | 70 |
| 72 const char* LayerTypeAsString() const override; | 71 const char* LayerTypeAsString() const override; |
| 73 | 72 |
| 74 void AsValueInto(base::debug::TracedValue* dict) const override; | 73 void AsValueInto(base::trace_event::TracedValue* dict) const override; |
| 75 | 74 |
| 76 void UpdateHudContents(); | 75 void UpdateHudContents(); |
| 77 void DrawHudContents(SkCanvas* canvas); | 76 void DrawHudContents(SkCanvas* canvas); |
| 78 | 77 |
| 79 void DrawText(SkCanvas* canvas, | 78 void DrawText(SkCanvas* canvas, |
| 80 SkPaint* paint, | 79 SkPaint* paint, |
| 81 const std::string& text, | 80 const std::string& text, |
| 82 SkPaint::Align align, | 81 SkPaint::Align align, |
| 83 int size, | 82 int size, |
| 84 int x, | 83 int x, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 float stroke_width, | 120 float stroke_width, |
| 122 const std::string& label_text) const; | 121 const std::string& label_text) const; |
| 123 void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history); | 122 void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history); |
| 124 | 123 |
| 125 void AcquireResource(ResourceProvider* resource_provider); | 124 void AcquireResource(ResourceProvider* resource_provider); |
| 126 void ReleaseUnmatchedSizeResources(ResourceProvider* resource_provider); | 125 void ReleaseUnmatchedSizeResources(ResourceProvider* resource_provider); |
| 127 | 126 |
| 128 ScopedPtrVector<ScopedResource> resources_; | 127 ScopedPtrVector<ScopedResource> resources_; |
| 129 skia::RefPtr<SkSurface> hud_surface_; | 128 skia::RefPtr<SkSurface> hud_surface_; |
| 130 | 129 |
| 130 float internal_contents_scale_; |
| 131 gfx::Size internal_content_bounds_; |
| 132 |
| 131 Graph fps_graph_; | 133 Graph fps_graph_; |
| 132 Graph paint_time_graph_; | 134 Graph paint_time_graph_; |
| 133 MemoryHistory::Entry memory_entry_; | 135 MemoryHistory::Entry memory_entry_; |
| 134 int fade_step_; | 136 int fade_step_; |
| 135 std::vector<DebugRect> paint_rects_; | 137 std::vector<DebugRect> paint_rects_; |
| 136 | 138 |
| 137 base::TimeTicks time_of_last_graph_update_; | 139 base::TimeTicks time_of_last_graph_update_; |
| 138 | 140 |
| 139 DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayerImpl); | 141 DISALLOW_COPY_AND_ASSIGN(HeadsUpDisplayLayerImpl); |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 } // namespace cc | 144 } // namespace cc |
| 143 | 145 |
| 144 #endif // CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ | 146 #endif // CC_LAYERS_HEADS_UP_DISPLAY_LAYER_IMPL_H_ |
| OLD | NEW |