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

Side by Side Diff: ui/compositor/compositor.cc

Issue 1126253005: cc: Add LayerTreeHost::InitParams for LayerTreeHost creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: all Created 5 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/compositor.h" 5 #include "ui/compositor/compositor.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 settings.use_one_copy = IsUIOneCopyEnabled(); 133 settings.use_one_copy = IsUIOneCopyEnabled();
134 settings.use_image_texture_target = context_factory_->GetImageTextureTarget(); 134 settings.use_image_texture_target = context_factory_->GetImageTextureTarget();
135 // Note: gathering of pixel refs is only needed when using multiple 135 // Note: gathering of pixel refs is only needed when using multiple
136 // raster threads. 136 // raster threads.
137 settings.gather_pixel_refs = false; 137 settings.gather_pixel_refs = false;
138 138
139 settings.use_compositor_animation_timelines = 139 settings.use_compositor_animation_timelines =
140 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines); 140 command_line->HasSwitch(switches::kUIEnableCompositorAnimationTimelines);
141 141
142 base::TimeTicks before_create = base::TimeTicks::Now(); 142 base::TimeTicks before_create = base::TimeTicks::Now();
143 host_ = cc::LayerTreeHost::CreateSingleThreaded( 143
144 this, this, context_factory_->GetSharedBitmapManager(), 144 cc::LayerTreeHost::InitParams params;
145 context_factory_->GetGpuMemoryBufferManager(), 145 params.client = this;
146 context_factory_->GetTaskGraphRunner(), settings, task_runner_, nullptr); 146 params.shared_bitmap_manager = context_factory_->GetSharedBitmapManager();
147 params.task_graph_runner = context_factory_->GetTaskGraphRunner();
148 params.settings = &settings;
149 params.main_task_runner = task_runner_;
150
151 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, &params);
147 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor", 152 UMA_HISTOGRAM_TIMES("GPU.CreateBrowserCompositor",
148 base::TimeTicks::Now() - before_create); 153 base::TimeTicks::Now() - before_create);
149 host_->SetRootLayer(root_web_layer_); 154 host_->SetRootLayer(root_web_layer_);
150 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace()); 155 host_->set_surface_id_namespace(surface_id_allocator_->id_namespace());
151 host_->SetLayerTreeHostClientReady(); 156 host_->SetLayerTreeHostClientReady();
152 } 157 }
153 158
154 Compositor::~Compositor() { 159 Compositor::~Compositor() {
155 TRACE_EVENT0("shutdown", "Compositor::destructor"); 160 TRACE_EVENT0("shutdown", "Compositor::destructor");
156 161
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 observer_list_, 430 observer_list_,
426 OnCompositingLockStateChanged(this)); 431 OnCompositingLockStateChanged(this));
427 } 432 }
428 433
429 void Compositor::CancelCompositorLock() { 434 void Compositor::CancelCompositorLock() {
430 if (compositor_lock_) 435 if (compositor_lock_)
431 compositor_lock_->CancelLock(); 436 compositor_lock_->CancelLock();
432 } 437 }
433 438
434 } // namespace ui 439 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698