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

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 947033002: CC Animations: Establish AnimationHost, AnimationTimeline and AnimationPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix MSVC warning. Created 5 years, 5 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 | « content/renderer/gpu/render_widget_compositor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
14 #include "base/profiler/scoped_tracker.h" 14 #include "base/profiler/scoped_tracker.h"
15 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
16 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
17 #include "base/synchronization/lock.h" 17 #include "base/synchronization/lock.h"
18 #include "base/sys_info.h" 18 #include "base/sys_info.h"
19 #include "base/thread_task_runner_handle.h" 19 #include "base/thread_task_runner_handle.h"
20 #include "base/time/time.h" 20 #include "base/time/time.h"
21 #include "base/values.h" 21 #include "base/values.h"
22 #include "cc/animation/animation_host.h"
23 #include "cc/animation/animation_timeline.h"
22 #include "cc/base/switches.h" 24 #include "cc/base/switches.h"
25 #include "cc/blink/web_compositor_animation_timeline_impl.h"
23 #include "cc/blink/web_layer_impl.h" 26 #include "cc/blink/web_layer_impl.h"
24 #include "cc/debug/layer_tree_debug_state.h" 27 #include "cc/debug/layer_tree_debug_state.h"
25 #include "cc/debug/micro_benchmark.h" 28 #include "cc/debug/micro_benchmark.h"
26 #include "cc/input/layer_selection_bound.h" 29 #include "cc/input/layer_selection_bound.h"
27 #include "cc/layers/layer.h" 30 #include "cc/layers/layer.h"
28 #include "cc/output/begin_frame_args.h" 31 #include "cc/output/begin_frame_args.h"
29 #include "cc/output/copy_output_request.h" 32 #include "cc/output/copy_output_request.h"
30 #include "cc/output/copy_output_result.h" 33 #include "cc/output/copy_output_result.h"
31 #include "cc/output/latency_info_swap_promise.h" 34 #include "cc/output/latency_info_swap_promise.h"
32 #include "cc/output/swap_promise.h" 35 #include "cc/output/swap_promise.h"
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 593
591 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { 594 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) {
592 layer_tree_host_->SetRootLayer( 595 layer_tree_host_->SetRootLayer(
593 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); 596 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer());
594 } 597 }
595 598
596 void RenderWidgetCompositor::clearRootLayer() { 599 void RenderWidgetCompositor::clearRootLayer() {
597 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>()); 600 layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>());
598 } 601 }
599 602
603 void RenderWidgetCompositor::attachCompositorAnimationTimeline(
604 blink::WebCompositorAnimationTimeline* compositor_timeline) {
605 DCHECK(compositor_timeline);
606 DCHECK(layer_tree_host_->animation_host());
607 layer_tree_host_->animation_host()->AddAnimationTimeline(
608 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>(
609 compositor_timeline)->animation_timeline());
610 }
611
612 void RenderWidgetCompositor::detachCompositorAnimationTimeline(
613 blink::WebCompositorAnimationTimeline* compositor_timeline) {
614 DCHECK(compositor_timeline);
615 DCHECK(layer_tree_host_->animation_host());
616 layer_tree_host_->animation_host()->RemoveAnimationTimeline(
617 static_cast<const cc_blink::WebCompositorAnimationTimelineImpl*>(
618 compositor_timeline)->animation_timeline());
619 }
620
600 void RenderWidgetCompositor::setViewportSize( 621 void RenderWidgetCompositor::setViewportSize(
601 const WebSize&, 622 const WebSize&,
602 const WebSize& device_viewport_size) { 623 const WebSize& device_viewport_size) {
603 layer_tree_host_->SetViewportSize(device_viewport_size); 624 layer_tree_host_->SetViewportSize(device_viewport_size);
604 } 625 }
605 626
606 void RenderWidgetCompositor::setViewportSize( 627 void RenderWidgetCompositor::setViewportSize(
607 const WebSize& device_viewport_size) { 628 const WebSize& device_viewport_size) {
608 layer_tree_host_->SetViewportSize(device_viewport_size); 629 layer_tree_host_->SetViewportSize(device_viewport_size);
609 } 630 }
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 return; 1048 return;
1028 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 1049 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
1029 } 1050 }
1030 1051
1031 void RenderWidgetCompositor::SetSurfaceIdNamespace( 1052 void RenderWidgetCompositor::SetSurfaceIdNamespace(
1032 uint32_t surface_id_namespace) { 1053 uint32_t surface_id_namespace) {
1033 layer_tree_host_->set_surface_id_namespace(surface_id_namespace); 1054 layer_tree_host_->set_surface_id_namespace(surface_id_namespace);
1034 } 1055 }
1035 1056
1036 } // namespace content 1057 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698