OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 87 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
88 | 88 |
89 cc::LayerTreeSettings settings; | 89 cc::LayerTreeSettings settings; |
90 | 90 |
91 // For web contents, layer transforms should scale up the contents of layers | 91 // For web contents, layer transforms should scale up the contents of layers |
92 // to keep content always crisp when possible. | 92 // to keep content always crisp when possible. |
93 settings.layer_transforms_should_scale_layer_contents = true; | 93 settings.layer_transforms_should_scale_layer_contents = true; |
94 | 94 |
95 settings.throttle_frame_production = | 95 settings.throttle_frame_production = |
96 !cmd->HasSwitch(switches::kDisableGpuVsync); | 96 !cmd->HasSwitch(switches::kDisableGpuVsync); |
97 settings.render_parent_drives_begin_frame_ = | 97 settings.begin_frame_scheduling_enabled = |
98 cmd->HasSwitch(switches::kEnableVsyncNotification); | 98 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); |
99 settings.using_synchronous_renderer_compositor = | 99 settings.using_synchronous_renderer_compositor = |
100 widget->UsingSynchronousRendererCompositor(); | 100 widget->UsingSynchronousRendererCompositor(); |
101 settings.per_tile_painting_enabled = | 101 settings.per_tile_painting_enabled = |
102 cmd->HasSwitch(cc::switches::kEnablePerTilePainting); | 102 cmd->HasSwitch(cc::switches::kEnablePerTilePainting); |
103 settings.accelerated_animation_enabled = | 103 settings.accelerated_animation_enabled = |
104 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 104 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
105 settings.force_direct_layer_drawing = | 105 settings.force_direct_layer_drawing = |
106 cmd->HasSwitch(cc::switches::kForceDirectLayerDrawing); | 106 cmd->HasSwitch(cc::switches::kForceDirectLayerDrawing); |
107 | 107 |
108 int default_tile_width = settings.default_tile_size.width(); | 108 int default_tile_width = settings.default_tile_size.width(); |
(...skipping 18 matching lines...) Expand all Loading... |
127 int max_untiled_layer_height = settings.max_untiled_layer_size.height(); | 127 int max_untiled_layer_height = settings.max_untiled_layer_size.height(); |
128 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) { | 128 if (cmd->HasSwitch(switches::kMaxUntiledLayerHeight)) { |
129 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1, | 129 GetSwitchValueAsInt(*cmd, switches::kMaxUntiledLayerHeight, 1, |
130 std::numeric_limits<int>::max(), | 130 std::numeric_limits<int>::max(), |
131 &max_untiled_layer_height); | 131 &max_untiled_layer_height); |
132 } | 132 } |
133 | 133 |
134 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width, | 134 settings.max_untiled_layer_size = gfx::Size(max_untiled_layer_width, |
135 max_untiled_layer_height); | 135 max_untiled_layer_height); |
136 | 136 |
137 settings.right_aligned_scheduling_enabled = | |
138 cmd->HasSwitch(cc::switches::kEnableRightAlignedScheduling); | |
139 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled(); | 137 settings.impl_side_painting = cc::switches::IsImplSidePaintingEnabled(); |
140 settings.use_color_estimator = | 138 settings.use_color_estimator = |
141 !cmd->HasSwitch(cc::switches::kDisableColorEstimator); | 139 !cmd->HasSwitch(cc::switches::kDisableColorEstimator); |
142 | 140 |
143 settings.calculate_top_controls_position = | 141 settings.calculate_top_controls_position = |
144 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); | 142 cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); |
145 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { | 143 if (cmd->HasSwitch(cc::switches::kTopControlsHeight)) { |
146 std::string controls_height_str = | 144 std::string controls_height_str = |
147 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); | 145 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHeight); |
148 double controls_height; | 146 double controls_height; |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 569 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
572 } | 570 } |
573 | 571 |
574 scoped_refptr<cc::ContextProvider> | 572 scoped_refptr<cc::ContextProvider> |
575 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 573 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
576 return RenderThreadImpl::current()-> | 574 return RenderThreadImpl::current()-> |
577 OffscreenContextProviderForCompositorThread(); | 575 OffscreenContextProviderForCompositorThread(); |
578 } | 576 } |
579 | 577 |
580 } // namespace content | 578 } // namespace content |
OLD | NEW |