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

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

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 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
« no previous file with comments | « cc/trees/layer_tree_host_common_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 <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 public: 60 public:
61 virtual void DidLoseOutputSurfaceOnImplThread() = 0; 61 virtual void DidLoseOutputSurfaceOnImplThread() = 0;
62 virtual void DidSwapBuffersOnImplThread() = 0; 62 virtual void DidSwapBuffersOnImplThread() = 0;
63 virtual void OnSwapBuffersCompleteOnImplThread() = 0; 63 virtual void OnSwapBuffersCompleteOnImplThread() = 0;
64 virtual void BeginImplFrame(const BeginFrameArgs& args) = 0; 64 virtual void BeginImplFrame(const BeginFrameArgs& args) = 0;
65 virtual void OnCanDrawStateChanged(bool can_draw) = 0; 65 virtual void OnCanDrawStateChanged(bool can_draw) = 0;
66 virtual void NotifyReadyToActivate() = 0; 66 virtual void NotifyReadyToActivate() = 0;
67 // Please call these 2 functions through 67 // Please call these 2 functions through
68 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect(). 68 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect().
69 virtual void SetNeedsRedrawOnImplThread() = 0; 69 virtual void SetNeedsRedrawOnImplThread() = 0;
70 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; 70 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0;
71 virtual void DidInitializeVisibleTileOnImplThread() = 0; 71 virtual void DidInitializeVisibleTileOnImplThread() = 0;
72 virtual void SetNeedsCommitOnImplThread() = 0; 72 virtual void SetNeedsCommitOnImplThread() = 0;
73 virtual void SetNeedsManageTilesOnImplThread() = 0; 73 virtual void SetNeedsManageTilesOnImplThread() = 0;
74 virtual void PostAnimationEventsToMainThreadOnImplThread( 74 virtual void PostAnimationEventsToMainThreadOnImplThread(
75 scoped_ptr<AnimationEventsVector> events, 75 scoped_ptr<AnimationEventsVector> events,
76 base::Time wall_clock_time) = 0; 76 base::Time wall_clock_time) = 0;
77 // Returns true if resources were deleted by this call. 77 // Returns true if resources were deleted by this call.
78 virtual bool ReduceContentsTextureMemoryOnImplThread( 78 virtual bool ReduceContentsTextureMemoryOnImplThread(
79 size_t limit_bytes, 79 size_t limit_bytes,
80 int priority_cutoff) = 0; 80 int priority_cutoff) = 0;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 virtual void BeginMainFrameAborted(bool did_handle); 164 virtual void BeginMainFrameAborted(bool did_handle);
165 virtual void BeginCommit(); 165 virtual void BeginCommit();
166 virtual void CommitComplete(); 166 virtual void CommitComplete();
167 virtual void Animate(base::TimeTicks monotonic_time, 167 virtual void Animate(base::TimeTicks monotonic_time,
168 base::Time wall_clock_time); 168 base::Time wall_clock_time);
169 virtual void UpdateAnimationState(bool start_ready_animations); 169 virtual void UpdateAnimationState(bool start_ready_animations);
170 void MainThreadHasStoppedFlinging(); 170 void MainThreadHasStoppedFlinging();
171 void UpdateBackgroundAnimateTicking(bool should_background_tick); 171 void UpdateBackgroundAnimateTicking(bool should_background_tick);
172 void DidAnimateScrollOffset(); 172 void DidAnimateScrollOffset();
173 void SetViewportDamage(gfx::Rect damage_rect); 173 void SetViewportDamage(const gfx::Rect& damage_rect);
174 174
175 virtual void ManageTiles(); 175 virtual void ManageTiles();
176 176
177 // Returns false if problems occured preparing the frame, and we should try 177 // Returns false if problems occured preparing the frame, and we should try
178 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers 178 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers
179 // must also be called, regardless of whether DrawLayers is called between the 179 // must also be called, regardless of whether DrawLayers is called between the
180 // two. 180 // two.
181 virtual bool PrepareToDraw(FrameData* frame, 181 virtual bool PrepareToDraw(FrameData* frame,
182 gfx::Rect device_viewport_damage_rect); 182 const gfx::Rect& damage_rect);
183 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); 183 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time);
184 // Must be called if and only if PrepareToDraw was called. 184 // Must be called if and only if PrepareToDraw was called.
185 void DidDrawAllLayers(const FrameData& frame); 185 void DidDrawAllLayers(const FrameData& frame);
186 186
187 const LayerTreeSettings& settings() const { return settings_; } 187 const LayerTreeSettings& settings() const { return settings_; }
188 188
189 // Evict all textures by enforcing a memory policy with an allocation of 0. 189 // Evict all textures by enforcing a memory policy with an allocation of 0.
190 void EvictTexturesForTesting(); 190 void EvictTexturesForTesting();
191 191
192 // When blocking, this prevents client_->NotifyReadyToActivate() from being 192 // When blocking, this prevents client_->NotifyReadyToActivate() from being
(...skipping 20 matching lines...) Expand all
213 // RendererClient implementation. 213 // RendererClient implementation.
214 virtual void SetFullRootLayerDamage() OVERRIDE; 214 virtual void SetFullRootLayerDamage() OVERRIDE;
215 215
216 // TileManagerClient implementation. 216 // TileManagerClient implementation.
217 virtual void NotifyReadyToActivate() OVERRIDE; 217 virtual void NotifyReadyToActivate() OVERRIDE;
218 218
219 // OutputSurfaceClient implementation. 219 // OutputSurfaceClient implementation.
220 virtual bool DeferredInitialize( 220 virtual bool DeferredInitialize(
221 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; 221 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE;
222 virtual void ReleaseGL() OVERRIDE; 222 virtual void ReleaseGL() OVERRIDE;
223 virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; 223 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) OVERRIDE;
224 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE; 224 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE;
225 virtual void SetExternalDrawConstraints( 225 virtual void SetExternalDrawConstraints(
226 const gfx::Transform& transform, 226 const gfx::Transform& transform,
227 gfx::Rect viewport, 227 const gfx::Rect& viewport,
228 gfx::Rect clip, 228 const gfx::Rect& clip,
229 bool valid_for_tile_management) OVERRIDE; 229 bool valid_for_tile_management) OVERRIDE;
230 virtual void DidLoseOutputSurface() OVERRIDE; 230 virtual void DidLoseOutputSurface() OVERRIDE;
231 virtual void DidSwapBuffers() OVERRIDE; 231 virtual void DidSwapBuffers() OVERRIDE;
232 virtual void OnSwapBuffersComplete() OVERRIDE; 232 virtual void OnSwapBuffersComplete() OVERRIDE;
233 virtual void ReclaimResources(const CompositorFrameAck* ack) OVERRIDE; 233 virtual void ReclaimResources(const CompositorFrameAck* ack) OVERRIDE;
234 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE; 234 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE;
235 virtual void SetTreeActivationCallback(const base::Closure& callback) 235 virtual void SetTreeActivationCallback(const base::Closure& callback)
236 OVERRIDE; 236 OVERRIDE;
237 237
238 // Called from LayerTreeImpl. 238 // Called from LayerTreeImpl.
(...skipping 17 matching lines...) Expand all
256 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); 256 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface);
257 bool IsContextLost(); 257 bool IsContextLost();
258 TileManager* tile_manager() { return tile_manager_.get(); } 258 TileManager* tile_manager() { return tile_manager_.get(); }
259 Renderer* renderer() { return renderer_.get(); } 259 Renderer* renderer() { return renderer_.get(); }
260 const RendererCapabilities& GetRendererCapabilities() const; 260 const RendererCapabilities& GetRendererCapabilities() const;
261 261
262 virtual bool SwapBuffers(const FrameData& frame); 262 virtual bool SwapBuffers(const FrameData& frame);
263 void SetNeedsBeginImplFrame(bool enable); 263 void SetNeedsBeginImplFrame(bool enable);
264 void DidModifyTilePriorities(); 264 void DidModifyTilePriorities();
265 265
266 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); 266 void Readback(void* pixels, const gfx::Rect& rect_in_device_viewport);
267 267
268 LayerTreeImpl* active_tree() { return active_tree_.get(); } 268 LayerTreeImpl* active_tree() { return active_tree_.get(); }
269 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } 269 const LayerTreeImpl* active_tree() const { return active_tree_.get(); }
270 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } 270 LayerTreeImpl* pending_tree() { return pending_tree_.get(); }
271 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } 271 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); }
272 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } 272 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); }
273 virtual void CreatePendingTree(); 273 virtual void CreatePendingTree();
274 virtual void UpdateVisibleTiles(); 274 virtual void UpdateVisibleTiles();
275 virtual void ActivatePendingTree(); 275 virtual void ActivatePendingTree();
276 276
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 int id_; 651 int id_;
652 652
653 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 653 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
654 654
655 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 655 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
656 }; 656 };
657 657
658 } // namespace cc 658 } // namespace cc
659 659
660 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 660 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_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