| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 hide_threshold >= 0.f && hide_threshold <= 1.f) | 270 hide_threshold >= 0.f && hide_threshold <= 1.f) |
| 271 settings.top_controls_hide_threshold = hide_threshold; | 271 settings.top_controls_hide_threshold = hide_threshold; |
| 272 } | 272 } |
| 273 | 273 |
| 274 settings.use_pinch_virtual_viewport = | 274 settings.use_pinch_virtual_viewport = |
| 275 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); | 275 cmd->HasSwitch(cc::switches::kEnablePinchVirtualViewport); |
| 276 settings.allow_antialiasing &= | 276 settings.allow_antialiasing &= |
| 277 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); | 277 !cmd->HasSwitch(cc::switches::kDisableCompositedAntialiasing); |
| 278 settings.single_thread_proxy_scheduler = | 278 settings.single_thread_proxy_scheduler = |
| 279 !cmd->HasSwitch(switches::kDisableSingleThreadProxyScheduler); | 279 !cmd->HasSwitch(switches::kDisableSingleThreadProxyScheduler); |
| 280 if (!threaded && !settings.single_thread_proxy_scheduler && |
| 281 settings.impl_side_painting) { |
| 282 // The synchronous composite path requires zero copy with impl-side |
| 283 // painting. |
| 284 settings.use_zero_copy = true; |
| 285 settings.scheduled_raster_task_limit = std::numeric_limits<size_t>::max(); |
| 286 } |
| 280 | 287 |
| 281 // These flags should be mirrored by UI versions in ui/compositor/. | 288 // These flags should be mirrored by UI versions in ui/compositor/. |
| 282 settings.initial_debug_state.show_debug_borders = | 289 settings.initial_debug_state.show_debug_borders = |
| 283 cmd->HasSwitch(cc::switches::kShowCompositedLayerBorders); | 290 cmd->HasSwitch(cc::switches::kShowCompositedLayerBorders); |
| 284 settings.initial_debug_state.show_fps_counter = | 291 settings.initial_debug_state.show_fps_counter = |
| 285 cmd->HasSwitch(cc::switches::kShowFPSCounter); | 292 cmd->HasSwitch(cc::switches::kShowFPSCounter); |
| 286 settings.initial_debug_state.show_layer_animation_bounds_rects = | 293 settings.initial_debug_state.show_layer_animation_bounds_rects = |
| 287 cmd->HasSwitch(cc::switches::kShowLayerAnimationBounds); | 294 cmd->HasSwitch(cc::switches::kShowLayerAnimationBounds); |
| 288 settings.initial_debug_state.show_paint_rects = | 295 settings.initial_debug_state.show_paint_rects = |
| 289 cmd->HasSwitch(switches::kShowPaintRects); | 296 cmd->HasSwitch(switches::kShowPaintRects); |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 widget_->OnSwapBuffersAborted(); | 878 widget_->OnSwapBuffersAborted(); |
| 872 } | 879 } |
| 873 | 880 |
| 874 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 881 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
| 875 cc::ContextProvider* provider = | 882 cc::ContextProvider* provider = |
| 876 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 883 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
| 877 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 884 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 878 } | 885 } |
| 879 | 886 |
| 880 } // namespace content | 887 } // namespace content |
| OLD | NEW |