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

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

Issue 1625473002: compositor-worker: blink->cc plumbing Base URL: https://chromium.googlesource.com/chromium/src.git@upstream-compositor-worker
Patch Set: Merge with landing of https://codereview.chromium.org/1599673002/ on master Created 4 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.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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/containers/hash_tables.h" 14 #include "base/containers/hash_tables.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "base/time/time.h" 17 #include "base/time/time.h"
18 #include "cc/animation/animation_registrar.h" 18 #include "cc/animation/animation_registrar.h"
19 #include "cc/animation/layer_tree_mutator.h"
19 #include "cc/animation/scrollbar_animation_controller.h" 20 #include "cc/animation/scrollbar_animation_controller.h"
20 #include "cc/base/cc_export.h" 21 #include "cc/base/cc_export.h"
21 #include "cc/base/synced_property.h" 22 #include "cc/base/synced_property.h"
22 #include "cc/debug/frame_timing_tracker.h" 23 #include "cc/debug/frame_timing_tracker.h"
23 #include "cc/debug/micro_benchmark_controller_impl.h" 24 #include "cc/debug/micro_benchmark_controller_impl.h"
24 #include "cc/input/input_handler.h" 25 #include "cc/input/input_handler.h"
25 #include "cc/input/top_controls_manager_client.h" 26 #include "cc/input/top_controls_manager_client.h"
26 #include "cc/layers/layer_lists.h" 27 #include "cc/layers/layer_lists.h"
27 #include "cc/layers/render_pass_sink.h" 28 #include "cc/layers/render_pass_sink.h"
28 #include "cc/output/begin_frame_args.h" 29 #include "cc/output/begin_frame_args.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering 138 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering
138 // state. 139 // state.
139 class CC_EXPORT LayerTreeHostImpl 140 class CC_EXPORT LayerTreeHostImpl
140 : public InputHandler, 141 : public InputHandler,
141 public RendererClient, 142 public RendererClient,
142 public TileManagerClient, 143 public TileManagerClient,
143 public OutputSurfaceClient, 144 public OutputSurfaceClient,
144 public TopControlsManagerClient, 145 public TopControlsManagerClient,
145 public ScrollbarAnimationControllerClient, 146 public ScrollbarAnimationControllerClient,
146 public VideoFrameControllerClient, 147 public VideoFrameControllerClient,
148 public LayerTreeMutatorClient,
147 public MutatorHostClient, 149 public MutatorHostClient,
148 public base::SupportsWeakPtr<LayerTreeHostImpl> { 150 public base::SupportsWeakPtr<LayerTreeHostImpl> {
149 public: 151 public:
150 static scoped_ptr<LayerTreeHostImpl> Create( 152 static scoped_ptr<LayerTreeHostImpl> Create(
151 const LayerTreeSettings& settings, 153 const LayerTreeSettings& settings,
152 LayerTreeHostImplClient* client, 154 LayerTreeHostImplClient* client,
153 TaskRunnerProvider* task_runner_provider, 155 TaskRunnerProvider* task_runner_provider,
154 RenderingStatsInstrumentation* rendering_stats_instrumentation, 156 RenderingStatsInstrumentation* rendering_stats_instrumentation,
155 SharedBitmapManager* shared_bitmap_manager, 157 SharedBitmapManager* shared_bitmap_manager,
156 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 158 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; 226 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override;
225 227
226 private: 228 private:
227 DISALLOW_COPY_AND_ASSIGN(FrameData); 229 DISALLOW_COPY_AND_ASSIGN(FrameData);
228 }; 230 };
229 231
230 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason); 232 virtual void BeginMainFrameAborted(CommitEarlyOutReason reason);
231 virtual void BeginCommit(); 233 virtual void BeginCommit();
232 virtual void CommitComplete(); 234 virtual void CommitComplete();
233 virtual void UpdateAnimationState(bool start_ready_animations); 235 virtual void UpdateAnimationState(bool start_ready_animations);
236 bool Mutate(base::TimeTicks monotinic_time);
234 void ActivateAnimations(); 237 void ActivateAnimations();
235 void Animate(); 238 void Animate();
236 void AnimatePendingTreeAfterCommit(); 239 void AnimatePendingTreeAfterCommit();
237 void MainThreadHasStoppedFlinging(); 240 void MainThreadHasStoppedFlinging();
238 void DidAnimateScrollOffset(); 241 void DidAnimateScrollOffset();
239 void SetViewportDamage(const gfx::Rect& damage_rect); 242 void SetViewportDamage(const gfx::Rect& damage_rect);
240 243
241 void SetTreeLayerFilterMutated(int layer_id, 244 void SetTreeLayerFilterMutated(int layer_id,
242 LayerTreeImpl* tree, 245 LayerTreeImpl* tree,
243 const FilterOperations& filters); 246 const FilterOperations& filters);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 void DidSwapBuffers() override; 358 void DidSwapBuffers() override;
356 void DidSwapBuffersComplete() override; 359 void DidSwapBuffersComplete() override;
357 void ReclaimResources(const CompositorFrameAck* ack) override; 360 void ReclaimResources(const CompositorFrameAck* ack) override;
358 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; 361 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
359 void SetTreeActivationCallback(const base::Closure& callback) override; 362 void SetTreeActivationCallback(const base::Closure& callback) override;
360 void OnDraw(const gfx::Transform& transform, 363 void OnDraw(const gfx::Transform& transform,
361 const gfx::Rect& viewport, 364 const gfx::Rect& viewport,
362 const gfx::Rect& clip, 365 const gfx::Rect& clip,
363 bool resourceless_software_draw) override; 366 bool resourceless_software_draw) override;
364 367
368 // LayerTreeMutatorClient.
369 void SetNeedsMutate() override;
370
365 // Called from LayerTreeImpl. 371 // Called from LayerTreeImpl.
366 void OnCanDrawStateChangedForTree(); 372 void OnCanDrawStateChangedForTree();
367 373
368 // Implementation. 374 // Implementation.
369 int id() const { return id_; } 375 int id() const { return id_; }
370 bool CanDraw() const; 376 bool CanDraw() const;
371 OutputSurface* output_surface() const { return output_surface_; } 377 OutputSurface* output_surface() const { return output_surface_; }
372 void ReleaseOutputSurface(); 378 void ReleaseOutputSurface();
373 379
374 std::string LayerTreeAsJson() const; 380 std::string LayerTreeAsJson() const;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 // the main frame args if it was scheduled. 594 // the main frame args if it was scheduled.
589 void RecordMainFrameTiming( 595 void RecordMainFrameTiming(
590 const BeginFrameArgs& start_of_main_frame_args, 596 const BeginFrameArgs& start_of_main_frame_args,
591 const BeginFrameArgs& expected_next_main_frame_args); 597 const BeginFrameArgs& expected_next_main_frame_args);
592 598
593 // Post the given frame timing events to the requester. 599 // Post the given frame timing events to the requester.
594 void PostFrameTimingEvents( 600 void PostFrameTimingEvents(
595 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events, 601 scoped_ptr<FrameTimingTracker::CompositeTimingSet> composite_events,
596 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events); 602 scoped_ptr<FrameTimingTracker::MainFrameTimingSet> main_frame_events);
597 603
604 void SetLayerTreeMutator(LayerTreeMutator* mutator);
605 LayerTreeMutator* mutator() { return mutator_; }
606
598 base::SingleThreadTaskRunner* GetTaskRunner() const { 607 base::SingleThreadTaskRunner* GetTaskRunner() const {
599 DCHECK(task_runner_provider_); 608 DCHECK(task_runner_provider_);
600 return task_runner_provider_->HasImplThread() 609 return task_runner_provider_->HasImplThread()
601 ? task_runner_provider_->ImplThreadTaskRunner() 610 ? task_runner_provider_->ImplThreadTaskRunner()
602 : task_runner_provider_->MainThreadTaskRunner(); 611 : task_runner_provider_->MainThreadTaskRunner();
603 } 612 }
604 613
605 protected: 614 protected:
606 LayerTreeHostImpl( 615 LayerTreeHostImpl(
607 const LayerTreeSettings& settings, 616 const LayerTreeSettings& settings,
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 MicroBenchmarkControllerImpl micro_benchmark_controller_; 825 MicroBenchmarkControllerImpl micro_benchmark_controller_;
817 scoped_ptr<SynchronousTaskGraphRunner> 826 scoped_ptr<SynchronousTaskGraphRunner>
818 single_thread_synchronous_task_graph_runner_; 827 single_thread_synchronous_task_graph_runner_;
819 828
820 // Optional callback to notify of new tree activations. 829 // Optional callback to notify of new tree activations.
821 base::Closure tree_activation_callback_; 830 base::Closure tree_activation_callback_;
822 831
823 SharedBitmapManager* shared_bitmap_manager_; 832 SharedBitmapManager* shared_bitmap_manager_;
824 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; 833 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_;
825 TaskGraphRunner* task_graph_runner_; 834 TaskGraphRunner* task_graph_runner_;
835 LayerTreeMutator* mutator_;
826 int id_; 836 int id_;
827 837
828 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 838 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
829 839
830 bool requires_high_res_to_draw_; 840 bool requires_high_res_to_draw_;
831 bool is_likely_to_require_a_draw_; 841 bool is_likely_to_require_a_draw_;
832 842
833 scoped_ptr<FrameTimingTracker> frame_timing_tracker_; 843 scoped_ptr<FrameTimingTracker> frame_timing_tracker_;
834 844
835 scoped_ptr<Viewport> viewport_; 845 scoped_ptr<Viewport> viewport_;
836 846
837 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 847 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
838 }; 848 };
839 849
840 } // namespace cc 850 } // namespace cc
841 851
842 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 852 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698