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

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 12662021: cc: Don't draw and swap if the frame will not change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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/trees/damage_tracker_unittest.cc ('k') | cc/trees/layer_tree_host_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 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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 FrameData(); 124 FrameData();
125 virtual ~FrameData(); 125 virtual ~FrameData();
126 126
127 std::vector<gfx::Rect> occluding_screen_space_rects; 127 std::vector<gfx::Rect> occluding_screen_space_rects;
128 std::vector<gfx::Rect> non_occluding_screen_space_rects; 128 std::vector<gfx::Rect> non_occluding_screen_space_rects;
129 RenderPassList render_passes; 129 RenderPassList render_passes;
130 RenderPassIdHashMap render_passes_by_id; 130 RenderPassIdHashMap render_passes_by_id;
131 const LayerImplList* render_surface_layer_list; 131 const LayerImplList* render_surface_layer_list;
132 LayerImplList will_draw_layers; 132 LayerImplList will_draw_layers;
133 bool contains_incomplete_tile; 133 bool contains_incomplete_tile;
134 bool has_no_damage;
134 135
135 // RenderPassSink implementation. 136 // RenderPassSink implementation.
136 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE; 137 virtual void AppendRenderPass(scoped_ptr<RenderPass> render_pass) OVERRIDE;
137 }; 138 };
138 139
139 virtual void BeginCommit(); 140 virtual void BeginCommit();
140 virtual void CommitComplete(); 141 virtual void CommitComplete();
141 virtual void Animate(base::TimeTicks monotonic_time, 142 virtual void Animate(base::TimeTicks monotonic_time,
142 base::Time wall_clock_time); 143 base::Time wall_clock_time);
143 virtual void UpdateAnimationState(bool start_ready_animations); 144 virtual void UpdateAnimationState(bool start_ready_animations);
144 void UpdateBackgroundAnimateTicking(bool should_background_tick); 145 void UpdateBackgroundAnimateTicking(bool should_background_tick);
145 146
146 void ManageTiles(); 147 void ManageTiles();
147 void SetAnticipatedDrawTime(base::TimeTicks time); 148 void SetAnticipatedDrawTime(base::TimeTicks time);
148 149
149 // Returns false if problems occured preparing the frame, and we should try 150 // Returns false if problems occured preparing the frame, and we should try
150 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers 151 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers
151 // must also be called, regardless of whether DrawLayers is called between the 152 // must also be called, regardless of whether DrawLayers is called between the
152 // two. 153 // two.
153 virtual bool PrepareToDraw(FrameData* frame); 154 virtual bool PrepareToDraw(FrameData* frame,
155 gfx::Rect device_viewport_damage_rect);
154 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); 156 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time);
155 // Must be called if and only if PrepareToDraw was called. 157 // Must be called if and only if PrepareToDraw was called.
156 void DidDrawAllLayers(const FrameData& frame); 158 void DidDrawAllLayers(const FrameData& frame);
157 159
158 const LayerTreeSettings& settings() const { return settings_; } 160 const LayerTreeSettings& settings() const { return settings_; }
159 161
160 // Returns the currently visible viewport size in DIP. This value excludes 162 // Returns the currently visible viewport size in DIP. This value excludes
161 // the URL bar and non-overlay scrollbars. 163 // the URL bar and non-overlay scrollbars.
162 gfx::SizeF VisibleViewportSize() const; 164 gfx::SizeF VisibleViewportSize() const;
163 165
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 203
202 void FinishAllRendering(); 204 void FinishAllRendering();
203 int SourceAnimationFrameNumber() const; 205 int SourceAnimationFrameNumber() const;
204 206
205 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); 207 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface);
206 bool IsContextLost(); 208 bool IsContextLost();
207 TileManager* tile_manager() { return tile_manager_.get(); } 209 TileManager* tile_manager() { return tile_manager_.get(); }
208 Renderer* renderer() { return renderer_.get(); } 210 Renderer* renderer() { return renderer_.get(); }
209 const RendererCapabilities& GetRendererCapabilities() const; 211 const RendererCapabilities& GetRendererCapabilities() const;
210 212
211 virtual bool SwapBuffers(); 213 virtual bool SwapBuffers(const FrameData& frame);
212 void EnableVSyncNotification(bool enable); 214 void EnableVSyncNotification(bool enable);
213 215
214 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); 216 void Readback(void* pixels, gfx::Rect rect_in_device_viewport);
215 217
216 LayerTreeImpl* active_tree() { return active_tree_.get(); } 218 LayerTreeImpl* active_tree() { return active_tree_.get(); }
217 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } 219 const LayerTreeImpl* active_tree() const { return active_tree_.get(); }
218 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } 220 LayerTreeImpl* pending_tree() { return pending_tree_.get(); }
219 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } 221 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); }
220 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } 222 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); }
221 void CreatePendingTree(); 223 void CreatePendingTree();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 scoped_ptr<DebugRectHistory> debug_rect_history_; 457 scoped_ptr<DebugRectHistory> debug_rect_history_;
456 458
457 // The maximum memory that would be used by the prioritized resource 459 // The maximum memory that would be used by the prioritized resource
458 // manager, if there were no limit on memory usage. 460 // manager, if there were no limit on memory usage.
459 size_t max_memory_needed_bytes_; 461 size_t max_memory_needed_bytes_;
460 462
461 size_t last_sent_memory_visible_bytes_; 463 size_t last_sent_memory_visible_bytes_;
462 size_t last_sent_memory_visible_and_nearby_bytes_; 464 size_t last_sent_memory_visible_and_nearby_bytes_;
463 size_t last_sent_memory_use_bytes_; 465 size_t last_sent_memory_use_bytes_;
464 466
467 bool next_frame_damages_full_device_viewport_;
468
465 base::TimeTicks current_frame_time_; 469 base::TimeTicks current_frame_time_;
466 470
467 scoped_ptr<AnimationRegistrar> animation_registrar_; 471 scoped_ptr<AnimationRegistrar> animation_registrar_;
468 472
469 RenderingStatsInstrumentation* rendering_stats_instrumentation_; 473 RenderingStatsInstrumentation* rendering_stats_instrumentation_;
470 474
471 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 475 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
472 }; 476 };
473 477
474 } // namespace cc 478 } // namespace cc
475 479
476 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 480 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « cc/trees/damage_tracker_unittest.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698