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

Unified Diff: content/renderer/render_widget.cc

Issue 337783002: Remove EnableThreadedCompositing from the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thread: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/shell/app/shell_main_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 73ab00862d967b0b3e2574d512c08cb8397fe76c..85e4286eb47c87d0f24a308a77e87c846b0ae6b7 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -149,6 +149,11 @@ ui::TextInputMode ConvertInputMode(const blink::WebString& input_mode) {
return it->second;
}
+bool IsThreadedCompositingEnabled() {
+ content::RenderThreadImpl* impl = content::RenderThreadImpl::current();
+ return impl && !!impl->compositor_message_loop_proxy().get();
+}
+
// TODO(brianderson): Replace the hard-coded threshold with a fraction of
// the BeginMainFrame interval.
// 4166us will allow 1/4 of a 60Hz interval or 1/2 of a 120Hz interval to
@@ -396,7 +401,6 @@ RenderWidget::RenderWidget(blink::WebPopupType popup_type,
suppress_next_char_events_(false),
screen_info_(screen_info),
device_scale_factor_(screen_info_.deviceScaleFactor),
- is_threaded_compositing_enabled_(false),
current_event_latency_info_(NULL),
next_output_surface_id_(0),
#if defined(OS_ANDROID)
@@ -410,9 +414,6 @@ RenderWidget::RenderWidget(blink::WebPopupType popup_type,
if (!swapped_out)
RenderProcess::current()->AddRefProcess();
DCHECK(RenderThread::Get());
- is_threaded_compositing_enabled_ =
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableThreadedCompositing);
device_color_profile_.push_back('0');
}
@@ -840,7 +841,7 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
uint32 output_surface_id = next_output_surface_id_++;
if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) {
- DCHECK(is_threaded_compositing_enabled_);
+ DCHECK(IsThreadedCompositingEnabled());
return scoped_ptr<cc::OutputSurface>(
new DelegatedCompositorOutputSurface(
routing_id(),
@@ -863,7 +864,7 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
// Composite-to-mailbox is currently used for layout tests in order to cause
// them to draw inside in the renderer to do the readback there. This should
// no longer be the case when crbug.com/311404 is fixed.
- DCHECK(is_threaded_compositing_enabled_ ||
+ DCHECK(IsThreadedCompositingEnabled() ||
RenderThreadImpl::current()->layout_test_mode());
cc::ResourceFormat format = cc::RGBA_8888;
if (base::SysInfo::IsLowEndDevice())
@@ -1172,8 +1173,8 @@ void RenderWidget::AutoResizeCompositor() {
}
void RenderWidget::initializeLayerTreeView() {
- compositor_ = RenderWidgetCompositor::Create(
- this, is_threaded_compositing_enabled_);
+ compositor_ =
+ RenderWidgetCompositor::Create(this, IsThreadedCompositingEnabled());
compositor_->setViewportSize(size_, physical_backing_size_);
if (init_complete_)
StartCompositor();
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/shell/app/shell_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698