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

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

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: WIP: pulling FRC out of OS Created 6 years, 9 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
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 class TopControlsManager; 54 class TopControlsManager;
55 class UIResourceBitmap; 55 class UIResourceBitmap;
56 class UIResourceRequest; 56 class UIResourceRequest;
57 struct RendererCapabilitiesImpl; 57 struct RendererCapabilitiesImpl;
58 58
59 // LayerTreeHost->Proxy callback interface. 59 // LayerTreeHost->Proxy callback interface.
60 class LayerTreeHostImplClient { 60 class LayerTreeHostImplClient {
61 public: 61 public:
62 virtual void UpdateRendererCapabilitiesOnImplThread() = 0; 62 virtual void UpdateRendererCapabilitiesOnImplThread() = 0;
63 virtual void DidLoseOutputSurfaceOnImplThread() = 0; 63 virtual void DidLoseOutputSurfaceOnImplThread() = 0;
64 virtual void SetMaxSwapsPending(int max) = 0;
64 virtual void DidSwapBuffersOnImplThread() = 0; 65 virtual void DidSwapBuffersOnImplThread() = 0;
65 virtual void OnSwapBuffersCompleteOnImplThread() = 0; 66 virtual void OnSwapBuffersCompleteOnImplThread() = 0;
66 virtual void BeginImplFrame(const BeginFrameArgs& args) = 0; 67 virtual void BeginImplFrame(const BeginFrameArgs& args) = 0;
67 virtual void OnCanDrawStateChanged(bool can_draw) = 0; 68 virtual void OnCanDrawStateChanged(bool can_draw) = 0;
68 virtual void NotifyReadyToActivate() = 0; 69 virtual void NotifyReadyToActivate() = 0;
69 // Please call these 2 functions through 70 // Please call these 2 functions through
70 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect(). 71 // LayerTreeHostImpl's SetNeedsRedraw() and SetNeedsRedrawRect().
71 virtual void SetNeedsRedrawOnImplThread() = 0; 72 virtual void SetNeedsRedrawOnImplThread() = 0;
72 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; 73 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0;
73 virtual void DidInitializeVisibleTileOnImplThread() = 0; 74 virtual void DidInitializeVisibleTileOnImplThread() = 0;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // RendererClient implementation. 218 // RendererClient implementation.
218 virtual void SetFullRootLayerDamage() OVERRIDE; 219 virtual void SetFullRootLayerDamage() OVERRIDE;
219 220
220 // TileManagerClient implementation. 221 // TileManagerClient implementation.
221 virtual void NotifyReadyToActivate() OVERRIDE; 222 virtual void NotifyReadyToActivate() OVERRIDE;
222 223
223 // OutputSurfaceClient implementation. 224 // OutputSurfaceClient implementation.
224 virtual bool DeferredInitialize( 225 virtual bool DeferredInitialize(
225 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; 226 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE;
226 virtual void ReleaseGL() OVERRIDE; 227 virtual void ReleaseGL() OVERRIDE;
228 virtual void CommitVSyncParameters(base::TimeTicks timebase,
229 base::TimeDelta interval) OVERRIDE;
227 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) OVERRIDE; 230 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) OVERRIDE;
228 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE; 231 virtual void BeginImplFrame(const BeginFrameArgs& args) OVERRIDE;
229 virtual void SetExternalDrawConstraints( 232 virtual void SetExternalDrawConstraints(
230 const gfx::Transform& transform, 233 const gfx::Transform& transform,
231 const gfx::Rect& viewport, 234 const gfx::Rect& viewport,
232 const gfx::Rect& clip, 235 const gfx::Rect& clip,
233 bool valid_for_tile_management) OVERRIDE; 236 bool valid_for_tile_management) OVERRIDE;
234 virtual void DidLoseOutputSurface() OVERRIDE; 237 virtual void DidLoseOutputSurface() OVERRIDE;
235 virtual void DidSwapBuffers() OVERRIDE; 238 virtual void DidSwapBuffers() OVERRIDE;
236 virtual void OnSwapBuffersComplete() OVERRIDE; 239 virtual void OnSwapBuffersComplete() OVERRIDE;
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 UIResourceMap; 532 UIResourceMap;
530 UIResourceMap ui_resource_map_; 533 UIResourceMap ui_resource_map_;
531 534
532 // Resources that were evicted by EvictAllUIResources. Resources are removed 535 // Resources that were evicted by EvictAllUIResources. Resources are removed
533 // from this when they are touched by a create or destroy from the UI resource 536 // from this when they are touched by a create or destroy from the UI resource
534 // request queue. 537 // request queue.
535 std::set<UIResourceId> evicted_ui_resources_; 538 std::set<UIResourceId> evicted_ui_resources_;
536 539
537 scoped_ptr<OutputSurface> output_surface_; 540 scoped_ptr<OutputSurface> output_surface_;
538 scoped_refptr<ContextProvider> offscreen_context_provider_; 541 scoped_refptr<ContextProvider> offscreen_context_provider_;
542 scoped_ptr<BeginFrameSource> begin_frame_source_;
539 543
540 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- 544 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile-
541 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). 545 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice().
542 scoped_ptr<ResourceProvider> resource_provider_; 546 scoped_ptr<ResourceProvider> resource_provider_;
543 scoped_ptr<TileManager> tile_manager_; 547 scoped_ptr<TileManager> tile_manager_;
544 scoped_ptr<Renderer> renderer_; 548 scoped_ptr<Renderer> renderer_;
545 549
546 GlobalStateThatImpactsTilePriority global_tile_state_; 550 GlobalStateThatImpactsTilePriority global_tile_state_;
547 551
548 // Tree currently being drawn. 552 // Tree currently being drawn.
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 int id_; 660 int id_;
657 661
658 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 662 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
659 663
660 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 664 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
661 }; 665 };
662 666
663 } // namespace cc 667 } // namespace cc
664 668
665 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 669 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698