OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_TREES_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 FrameData(); | 118 FrameData(); |
119 ~FrameData(); | 119 ~FrameData(); |
120 | 120 |
121 std::vector<gfx::Rect> occluding_screen_space_rects; | 121 std::vector<gfx::Rect> occluding_screen_space_rects; |
122 std::vector<gfx::Rect> non_occluding_screen_space_rects; | 122 std::vector<gfx::Rect> non_occluding_screen_space_rects; |
123 RenderPassList render_passes; | 123 RenderPassList render_passes; |
124 RenderPassIdHashMap render_passes_by_id; | 124 RenderPassIdHashMap render_passes_by_id; |
125 const LayerList* render_surface_layer_list; | 125 const LayerList* render_surface_layer_list; |
126 LayerList will_draw_layers; | 126 LayerList will_draw_layers; |
127 bool contains_incomplete_tile; | 127 bool contains_incomplete_tile; |
128 bool has_no_damage; | |
enne (OOO)
2013/03/26 01:42:07
Weren't you just saying FrameData had too many mem
danakj
2013/03/26 02:00:10
Yes, this is bad and I feel bad.
I tried to do th
| |
128 | 129 |
129 // RenderPassSink implementation. | 130 // RenderPassSink implementation. |
130 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; | 131 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; |
131 }; | 132 }; |
132 | 133 |
133 virtual void BeginCommit(); | 134 virtual void BeginCommit(); |
134 virtual void CommitComplete(); | 135 virtual void CommitComplete(); |
135 virtual void Animate(base::TimeTicks monotonic_time, | 136 virtual void Animate(base::TimeTicks monotonic_time, |
136 base::Time wall_clock_time); | 137 base::Time wall_clock_time); |
137 | 138 |
138 void ManageTiles(); | 139 void ManageTiles(); |
139 void SetAnticipatedDrawTime(base::TimeTicks time); | 140 void SetAnticipatedDrawTime(base::TimeTicks time); |
140 | 141 |
141 // Returns false if problems occured preparing the frame, and we should try | 142 // Returns false if problems occured preparing the frame, and we should try |
142 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers | 143 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers |
143 // must also be called, regardless of whether DrawLayers is called between the | 144 // must also be called, regardless of whether DrawLayers is called between the |
144 // two. | 145 // two. |
145 virtual bool PrepareToDraw(FrameData* frame); | 146 virtual bool PrepareToDraw(FrameData* frame, |
147 gfx::Rect device_viewport_damage_rect); | |
146 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 148 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
147 // Must be called if and only if PrepareToDraw was called. | 149 // Must be called if and only if PrepareToDraw was called. |
148 void DidDrawAllLayers(const FrameData& frame); | 150 void DidDrawAllLayers(const FrameData& frame); |
149 | 151 |
150 const LayerTreeSettings& settings() const { return settings_; } | 152 const LayerTreeSettings& settings() const { return settings_; } |
151 | 153 |
152 // Returns the currently visible viewport size in DIP. This value excludes | 154 // Returns the currently visible viewport size in DIP. This value excludes |
153 // the URL bar and non-overlay scrollbars. | 155 // the URL bar and non-overlay scrollbars. |
154 gfx::SizeF VisibleViewportSize() const; | 156 gfx::SizeF VisibleViewportSize() const; |
155 | 157 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 | 193 |
192 void FinishAllRendering(); | 194 void FinishAllRendering(); |
193 int SourceAnimationFrameNumber() const; | 195 int SourceAnimationFrameNumber() const; |
194 | 196 |
195 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); | 197 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); |
196 bool IsContextLost(); | 198 bool IsContextLost(); |
197 TileManager* tile_manager() { return tile_manager_.get(); } | 199 TileManager* tile_manager() { return tile_manager_.get(); } |
198 Renderer* renderer() { return renderer_.get(); } | 200 Renderer* renderer() { return renderer_.get(); } |
199 const RendererCapabilities& GetRendererCapabilities() const; | 201 const RendererCapabilities& GetRendererCapabilities() const; |
200 | 202 |
201 virtual bool SwapBuffers(); | 203 virtual bool SwapBuffers(const FrameData& frame); |
202 | 204 |
203 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); | 205 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); |
204 | 206 |
205 LayerTreeImpl* active_tree() { return active_tree_.get(); } | 207 LayerTreeImpl* active_tree() { return active_tree_.get(); } |
206 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } | 208 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
207 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } | 209 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
208 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } | 210 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
209 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } | 211 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
210 void CreatePendingTree(); | 212 void CreatePendingTree(); |
211 void CheckForCompletedTileUploads(); | 213 void CheckForCompletedTileUploads(); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 | 442 |
441 scoped_ptr<FrameRateCounter> fps_counter_; | 443 scoped_ptr<FrameRateCounter> fps_counter_; |
442 scoped_ptr<PaintTimeCounter> paint_time_counter_; | 444 scoped_ptr<PaintTimeCounter> paint_time_counter_; |
443 scoped_ptr<MemoryHistory> memory_history_; | 445 scoped_ptr<MemoryHistory> memory_history_; |
444 scoped_ptr<DebugRectHistory> debug_rect_history_; | 446 scoped_ptr<DebugRectHistory> debug_rect_history_; |
445 | 447 |
446 int64 num_impl_thread_scrolls_; | 448 int64 num_impl_thread_scrolls_; |
447 int64 num_main_thread_scrolls_; | 449 int64 num_main_thread_scrolls_; |
448 | 450 |
449 int64 cumulative_num_layers_drawn_; | 451 int64 cumulative_num_layers_drawn_; |
450 | |
451 int64 cumulative_num_missing_tiles_; | 452 int64 cumulative_num_missing_tiles_; |
452 | 453 |
453 size_t last_sent_memory_visible_bytes_; | 454 size_t last_sent_memory_visible_bytes_; |
454 size_t last_sent_memory_visible_and_nearby_bytes_; | 455 size_t last_sent_memory_visible_and_nearby_bytes_; |
455 size_t last_sent_memory_use_bytes_; | 456 size_t last_sent_memory_use_bytes_; |
456 | 457 |
458 bool next_frame_damages_full_device_viewport_; | |
459 | |
457 base::TimeTicks current_frame_time_; | 460 base::TimeTicks current_frame_time_; |
458 | 461 |
459 scoped_ptr<AnimationRegistrar> animation_registrar_; | 462 scoped_ptr<AnimationRegistrar> animation_registrar_; |
460 | 463 |
461 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 464 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
462 | 465 |
463 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 466 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
464 }; | 467 }; |
465 | 468 |
466 } // namespace cc | 469 } // namespace cc |
467 | 470 |
468 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 471 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |