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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 166 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
167 | 167 |
168 cc::LayerTreeSettings settings; | 168 cc::LayerTreeSettings settings; |
169 | 169 |
170 // For web contents, layer transforms should scale up the contents of layers | 170 // For web contents, layer transforms should scale up the contents of layers |
171 // to keep content always crisp when possible. | 171 // to keep content always crisp when possible. |
172 settings.layer_transforms_should_scale_layer_contents = true; | 172 settings.layer_transforms_should_scale_layer_contents = true; |
173 | 173 |
174 settings.throttle_frame_production = | 174 settings.throttle_frame_production = |
175 !cmd->HasSwitch(switches::kDisableGpuVsync); | 175 !cmd->HasSwitch(switches::kDisableGpuVsync); |
176 settings.begin_frame_scheduling_enabled = | 176 settings.begin_frame_receiver = |
177 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 177 cmd->HasSwitch(cc::switches::kEnableBeginFrameScheduling); |
178 settings.main_frame_before_activation_enabled = | 178 settings.main_frame_before_activation_enabled = |
179 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 179 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
180 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 180 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
181 settings.main_frame_before_draw_enabled = | 181 settings.main_frame_before_draw_enabled = |
182 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); | 182 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); |
183 settings.report_overscroll_only_for_scrollable_axes = true; | 183 settings.report_overscroll_only_for_scrollable_axes = true; |
184 settings.accelerated_animation_enabled = | 184 settings.accelerated_animation_enabled = |
185 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 185 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
186 | 186 |
187 settings.default_tile_size = CalculateDefaultTileSize(); | 187 settings.default_tile_size = CalculateDefaultTileSize(); |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 widget_->OnSwapBuffersAborted(); | 849 widget_->OnSwapBuffersAborted(); |
850 } | 850 } |
851 | 851 |
852 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 852 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
853 cc::ContextProvider* provider = | 853 cc::ContextProvider* provider = |
854 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 854 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
855 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 855 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
856 } | 856 } |
857 | 857 |
858 } // namespace content | 858 } // namespace content |
OLD | NEW |