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

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

Issue 1126253005: cc: Add LayerTreeHost::InitParams for LayerTreeHost creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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) 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"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 compositor_deps_->GetGpuMemoryBufferManager(); 474 compositor_deps_->GetGpuMemoryBufferManager();
475 cc::TaskGraphRunner* task_graph_runner = 475 cc::TaskGraphRunner* task_graph_runner =
476 compositor_deps_->GetTaskGraphRunner(); 476 compositor_deps_->GetTaskGraphRunner();
477 477
478 scoped_ptr<cc::BeginFrameSource> external_begin_frame_source; 478 scoped_ptr<cc::BeginFrameSource> external_begin_frame_source;
479 if (settings.use_external_begin_frame_source) { 479 if (settings.use_external_begin_frame_source) {
480 external_begin_frame_source = 480 external_begin_frame_source =
481 compositor_deps_->CreateExternalBeginFrameSource(widget_->routing_id()); 481 compositor_deps_->CreateExternalBeginFrameSource(widget_->routing_id());
482 } 482 }
483 483
484 cc::LayerTreeHost::InitParams params;
485 params.client = this;
486 params.shared_bitmap_manager = shared_bitmap_manager;
487 params.gpu_memory_buffer_manager = gpu_memory_buffer_manager;
488 params.settings = &settings;
489 params.task_graph_runner = task_graph_runner;
490 params.main_task_runner = main_thread_compositor_task_runner;
491 params.external_begin_frame_source = external_begin_frame_source.Pass();
484 if (compositor_thread_task_runner.get()) { 492 if (compositor_thread_task_runner.get()) {
485 layer_tree_host_ = cc::LayerTreeHost::CreateThreaded( 493 layer_tree_host_ = cc::LayerTreeHost::CreateThreaded(
486 this, shared_bitmap_manager, gpu_memory_buffer_manager, 494 compositor_thread_task_runner, &params);
487 task_graph_runner, settings, main_thread_compositor_task_runner,
488 compositor_thread_task_runner, external_begin_frame_source.Pass());
489 } else { 495 } else {
490 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded( 496 layer_tree_host_ = cc::LayerTreeHost::CreateSingleThreaded(this, &params);
491 this, this, shared_bitmap_manager, gpu_memory_buffer_manager,
492 task_graph_runner, settings, main_thread_compositor_task_runner,
493 external_begin_frame_source.Pass());
494 } 497 }
495 DCHECK(layer_tree_host_); 498 DCHECK(layer_tree_host_);
496 } 499 }
497 500
498 RenderWidgetCompositor::~RenderWidgetCompositor() {} 501 RenderWidgetCompositor::~RenderWidgetCompositor() {}
499 502
500 const base::WeakPtr<cc::InputHandler>& 503 const base::WeakPtr<cc::InputHandler>&
501 RenderWidgetCompositor::GetInputHandler() { 504 RenderWidgetCompositor::GetInputHandler() {
502 return layer_tree_host_->GetInputHandler(); 505 return layer_tree_host_->GetInputHandler();
503 } 506 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 cc::ContextProvider* provider = 970 cc::ContextProvider* provider =
968 compositor_deps_->GetSharedMainThreadContextProvider(); 971 compositor_deps_->GetSharedMainThreadContextProvider();
969 // provider can be NULL after the GPU process crashed enough times and we 972 // provider can be NULL after the GPU process crashed enough times and we
970 // don't want to restart it any more (falling back to software). 973 // don't want to restart it any more (falling back to software).
971 if (!provider) 974 if (!provider)
972 return; 975 return;
973 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); 976 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM();
974 } 977 }
975 978
976 } // namespace content 979 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/compositor_impl_android.cc ('k') | content/test/web_layer_tree_view_impl_for_testing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698