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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | content/renderer/input/input_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 344f7abe32216e72faa5b61efe5fc18be3e4cd0e..faa1b9cb47952b934dee11d70bc4df5909570b81 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -239,6 +239,8 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) {
cc::LayerTreeSettings settings =
GenerateLayerTreeSettings(*cmd, compositor_deps_, device_scale_factor);
+ animation_host_ = cc::AnimationHost::CreateMainInstance();
+
if (cmd->HasSwitch(switches::kUseRemoteCompositing) &&
cmd->HasSwitch(switches::kUseLayerTreeHostRemote)) {
DCHECK(!threaded_);
@@ -247,7 +249,7 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) {
params.client = this;
params.main_task_runner =
compositor_deps_->GetCompositorMainThreadTaskRunner();
- params.animation_host = cc::AnimationHost::CreateMainInstance();
+ params.mutator_host = animation_host_.get();
params.remote_compositor_bridge =
GetContentClient()->renderer()->CreateRemoteCompositorBridge(
this, params.main_task_runner);
@@ -265,7 +267,7 @@ void RenderWidgetCompositor::Initialize(float device_scale_factor) {
params.task_graph_runner = compositor_deps_->GetTaskGraphRunner();
params.main_task_runner =
compositor_deps_->GetCompositorMainThreadTaskRunner();
- params.animation_host = cc::AnimationHost::CreateMainInstance();
+ params.mutator_host = animation_host_.get();
if (cmd->HasSwitch(switches::kUseRemoteCompositing)) {
DCHECK(!threaded_);
@@ -680,18 +682,16 @@ void RenderWidgetCompositor::clearRootLayer() {
void RenderWidgetCompositor::attachCompositorAnimationTimeline(
cc::AnimationTimeline* compositor_timeline) {
- cc::AnimationHost* animation_host =
- layer_tree_host_->GetLayerTree()->animation_host();
- DCHECK(animation_host);
- animation_host->AddAnimationTimeline(compositor_timeline);
+ DCHECK(animation_host_);
+ DCHECK(compositor_deps_->IsThreadedAnimationEnabled());
+ animation_host_->AddAnimationTimeline(compositor_timeline);
}
void RenderWidgetCompositor::detachCompositorAnimationTimeline(
cc::AnimationTimeline* compositor_timeline) {
- cc::AnimationHost* animation_host =
- layer_tree_host_->GetLayerTree()->animation_host();
- DCHECK(animation_host);
- animation_host->RemoveAnimationTimeline(compositor_timeline);
+ DCHECK(animation_host_);
+ DCHECK(compositor_deps_->IsThreadedAnimationEnabled());
+ animation_host_->RemoveAnimationTimeline(compositor_timeline);
}
void RenderWidgetCompositor::setViewportSize(
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.h ('k') | content/renderer/input/input_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698