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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 11824040: Enables compositing support for webview. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed build error on mac and win, nits Created 7 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 | « content/renderer/browser_plugin/browser_plugin_manager_impl.cc ('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) 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 "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 WebKit::initialize(webkit_platform_support_.get()); 585 WebKit::initialize(webkit_platform_support_.get());
586 WebKit::setSharedWorkerRepository( 586 WebKit::setSharedWorkerRepository(
587 webkit_platform_support_.get()->sharedWorkerRepository()); 587 webkit_platform_support_.get()->sharedWorkerRepository());
588 WebKit::setIDBFactory( 588 WebKit::setIDBFactory(
589 webkit_platform_support_.get()->idbFactory()); 589 webkit_platform_support_.get()->idbFactory());
590 590
591 WebKit::WebCompositorSupport* compositor_support = 591 WebKit::WebCompositorSupport* compositor_support =
592 WebKit::Platform::current()->compositorSupport(); 592 WebKit::Platform::current()->compositorSupport();
593 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 593 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
594 594
595 // TODO(fsamuel): Guests don't currently support threaded compositing. 595 bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing);
596 // This should go away with the new design of the browser plugin.
597 // The new design can be tracked at: http://crbug.com/134492.
598 bool is_guest = command_line.HasSwitch(switches::kGuestRenderer);
599 bool threaded = command_line.HasSwitch(switches::kEnableThreadedCompositing);
600
601 bool enable = threaded && !is_guest;
602 if (enable) { 596 if (enable) {
603 compositor_thread_.reset(new CompositorThread(this)); 597 compositor_thread_.reset(new CompositorThread(this));
604 AddFilter(compositor_thread_->GetMessageFilter()); 598 AddFilter(compositor_thread_->GetMessageFilter());
605 compositor_support->initialize(compositor_thread_->GetWebThread()); 599 compositor_support->initialize(compositor_thread_->GetWebThread());
606 } else { 600 } else {
607 compositor_support->initialize(NULL); 601 compositor_support->initialize(NULL);
608 } 602 }
609 compositor_initialized_ = true; 603 compositor_initialized_ = true;
610 604
611 MessageLoop* output_surface_loop = enable ? 605 MessageLoop* output_surface_loop = enable ?
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 RenderThreadImpl::GetFileThreadMessageLoopProxy() { 1146 RenderThreadImpl::GetFileThreadMessageLoopProxy() {
1153 DCHECK(message_loop() == MessageLoop::current()); 1147 DCHECK(message_loop() == MessageLoop::current());
1154 if (!file_thread_.get()) { 1148 if (!file_thread_.get()) {
1155 file_thread_.reset(new base::Thread("Renderer::FILE")); 1149 file_thread_.reset(new base::Thread("Renderer::FILE"));
1156 file_thread_->Start(); 1150 file_thread_->Start();
1157 } 1151 }
1158 return file_thread_->message_loop_proxy(); 1152 return file_thread_->message_loop_proxy();
1159 } 1153 }
1160 1154
1161 } // namespace content 1155 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698