Chromium Code Reviews| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 162 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 163 | 163 |
| 164 cc::LayerTreeSettings settings; | 164 cc::LayerTreeSettings settings; |
| 165 | 165 |
| 166 // For web contents, layer transforms should scale up the contents of layers | 166 // For web contents, layer transforms should scale up the contents of layers |
| 167 // to keep content always crisp when possible. | 167 // to keep content always crisp when possible. |
| 168 settings.layer_transforms_should_scale_layer_contents = true; | 168 settings.layer_transforms_should_scale_layer_contents = true; |
| 169 | 169 |
| 170 settings.throttle_frame_production = | 170 settings.throttle_frame_production = |
| 171 !cmd->HasSwitch(switches::kDisableGpuVsync); | 171 !cmd->HasSwitch(switches::kDisableGpuVsync); |
| 172 settings.begin_frame_scheduling_enabled = | 172 #if defined(OS_ANDROID) || (defined(USE_AURA) &&!defined(OS_CHROMEOS)) |
|
brianderson
2014/09/04 18:45:46
Why !OS_CHROMEOS?
For platforms other than Mac, ca
| |
| 173 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 173 settings.begin_frame_receiver = true; |
| 174 #elif defined(OS_MACOSX) | |
| 175 // Mac only uses browser compositor when delegated renderer is used. | |
| 176 if (cmd->HasSwitch(switches::kEnableDelegatedRenderer)) | |
| 177 settings.begin_frame_receiver = true; | |
| 178 #endif | |
| 174 settings.main_frame_before_activation_enabled = | 179 settings.main_frame_before_activation_enabled = |
| 175 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 180 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
| 176 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 181 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
| 177 settings.main_frame_before_draw_enabled = | 182 settings.main_frame_before_draw_enabled = |
| 178 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); | 183 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); |
| 179 settings.report_overscroll_only_for_scrollable_axes = true; | 184 settings.report_overscroll_only_for_scrollable_axes = true; |
| 180 settings.accelerated_animation_enabled = | 185 settings.accelerated_animation_enabled = |
| 181 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 186 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
| 182 | 187 |
| 183 settings.default_tile_size = CalculateDefaultTileSize(); | 188 settings.default_tile_size = CalculateDefaultTileSize(); |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 799 widget_->OnSwapBuffersAborted(); | 804 widget_->OnSwapBuffersAborted(); |
| 800 } | 805 } |
| 801 | 806 |
| 802 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 807 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 803 cc::ContextProvider* provider = | 808 cc::ContextProvider* provider = |
| 804 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 809 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 805 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 810 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 806 } | 811 } |
| 807 | 812 |
| 808 } // namespace content | 813 } // namespace content |
| OLD | NEW |