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 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 CommandLine* cmd = CommandLine::ForCurrentProcess(); | 83 CommandLine* cmd = CommandLine::ForCurrentProcess(); |
84 | 84 |
85 cc::LayerTreeSettings settings; | 85 cc::LayerTreeSettings settings; |
86 | 86 |
87 // For web contents, layer transforms should scale up the contents of layers | 87 // For web contents, layer transforms should scale up the contents of layers |
88 // to keep content always crisp when possible. | 88 // to keep content always crisp when possible. |
89 settings.layer_transforms_should_scale_layer_contents = true; | 89 settings.layer_transforms_should_scale_layer_contents = true; |
90 | 90 |
91 settings.throttle_frame_production = | 91 settings.throttle_frame_production = |
92 !cmd->HasSwitch(switches::kDisableGpuVsync); | 92 !cmd->HasSwitch(switches::kDisableGpuVsync); |
93 settings.begin_impl_frame_scheduling_enabled = | 93 settings.begin_frame_scheduling_enabled = |
94 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); | 94 cmd->HasSwitch(switches::kEnableBeginFrameScheduling); |
95 settings.main_frame_before_activation_enabled = | 95 settings.main_frame_before_activation_enabled = |
96 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 96 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
97 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 97 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
98 settings.main_frame_before_draw_enabled = | 98 settings.main_frame_before_draw_enabled = |
99 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); | 99 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeDraw); |
100 settings.using_synchronous_renderer_compositor = | 100 settings.using_synchronous_renderer_compositor = |
101 widget->UsingSynchronousRendererCompositor(); | 101 widget->UsingSynchronousRendererCompositor(); |
102 settings.report_overscroll_only_for_scrollable_axes = | 102 settings.report_overscroll_only_for_scrollable_axes = |
103 !widget->UsingSynchronousRendererCompositor(); | 103 !widget->UsingSynchronousRendererCompositor(); |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 widget_->OnSwapBuffersAborted(); | 653 widget_->OnSwapBuffersAborted(); |
654 } | 654 } |
655 | 655 |
656 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { | 656 void RenderWidgetCompositor::RateLimitSharedMainThreadContext() { |
657 cc::ContextProvider* provider = | 657 cc::ContextProvider* provider = |
658 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); | 658 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); |
659 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 659 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
660 } | 660 } |
661 | 661 |
662 } // namespace content | 662 } // namespace content |
OLD | NEW |