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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 !cmd->HasSwitch(switches::kDisableGpuVsync); | 223 !cmd->HasSwitch(switches::kDisableGpuVsync); |
224 settings.main_frame_before_activation_enabled = | 224 settings.main_frame_before_activation_enabled = |
225 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && | 225 cmd->HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) && |
226 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); | 226 !cmd->HasSwitch(cc::switches::kDisableMainFrameBeforeActivation); |
227 settings.report_overscroll_only_for_scrollable_axes = | 227 settings.report_overscroll_only_for_scrollable_axes = |
228 !compositor_deps_->IsElasticOverscrollEnabled(); | 228 !compositor_deps_->IsElasticOverscrollEnabled(); |
229 settings.accelerated_animation_enabled = | 229 settings.accelerated_animation_enabled = |
230 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); | 230 !cmd->HasSwitch(cc::switches::kDisableThreadedAnimation); |
231 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); | 231 settings.use_display_lists = cmd->HasSwitch(switches::kEnableSlimmingPaint); |
232 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) { | 232 if (cmd->HasSwitch(switches::kEnableCompositorAnimationTimelines)) { |
233 settings.use_compositor_animation_timelines = true; | 233 settings.hud_layer_settings_.use_compositor_animation_timelines = true; |
piman
2015/05/11 21:31:24
Could you use WebLayerImpl::LayerSettings() here f
| |
234 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); | 234 blink::WebRuntimeFeatures::enableCompositorAnimationTimelines(true); |
235 } | 235 } |
236 if (cmd->HasSwitch(switches::kEnableBeginFrameScheduling) && | 236 if (cmd->HasSwitch(switches::kEnableBeginFrameScheduling) && |
237 !widget_->for_oopif()) { | 237 !widget_->for_oopif()) { |
238 // TODO(simonhong): Apply BeginFrame scheduling for OOPIF. | 238 // TODO(simonhong): Apply BeginFrame scheduling for OOPIF. |
239 // See crbug.com/471411. | 239 // See crbug.com/471411. |
240 settings.use_external_begin_frame_source = true; | 240 settings.use_external_begin_frame_source = true; |
241 } | 241 } |
242 | 242 |
243 settings.default_tile_size = CalculateDefaultTileSize(widget_); | 243 settings.default_tile_size = CalculateDefaultTileSize(widget_); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
654 bool RenderWidgetCompositor::commitRequested() const { | 654 bool RenderWidgetCompositor::commitRequested() const { |
655 return layer_tree_host_->CommitRequested(); | 655 return layer_tree_host_->CommitRequested(); |
656 } | 656 } |
657 | 657 |
658 void RenderWidgetCompositor::didStopFlinging() { | 658 void RenderWidgetCompositor::didStopFlinging() { |
659 layer_tree_host_->DidStopFlinging(); | 659 layer_tree_host_->DidStopFlinging(); |
660 } | 660 } |
661 | 661 |
662 void RenderWidgetCompositor::registerForAnimations(blink::WebLayer* layer) { | 662 void RenderWidgetCompositor::registerForAnimations(blink::WebLayer* layer) { |
663 cc::Layer* cc_layer = static_cast<cc_blink::WebLayerImpl*>(layer)->layer(); | 663 cc::Layer* cc_layer = static_cast<cc_blink::WebLayerImpl*>(layer)->layer(); |
664 cc_layer->layer_animation_controller()->SetAnimationRegistrar( | 664 cc_layer->RegisterForAnimations(layer_tree_host_->animation_registrar()); |
665 layer_tree_host_->animation_registrar()); | |
666 } | 665 } |
667 | 666 |
668 void RenderWidgetCompositor::registerViewportLayers( | 667 void RenderWidgetCompositor::registerViewportLayers( |
669 const blink::WebLayer* overscrollElasticityLayer, | 668 const blink::WebLayer* overscrollElasticityLayer, |
670 const blink::WebLayer* pageScaleLayer, | 669 const blink::WebLayer* pageScaleLayer, |
671 const blink::WebLayer* innerViewportScrollLayer, | 670 const blink::WebLayer* innerViewportScrollLayer, |
672 const blink::WebLayer* outerViewportScrollLayer) { | 671 const blink::WebLayer* outerViewportScrollLayer) { |
673 layer_tree_host_->RegisterViewportLayers( | 672 layer_tree_host_->RegisterViewportLayers( |
674 // The scroll elasticity layer will only exist when using pinch virtual | 673 // The scroll elasticity layer will only exist when using pinch virtual |
675 // viewports. | 674 // viewports. |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
936 cc::ContextProvider* provider = | 935 cc::ContextProvider* provider = |
937 compositor_deps_->GetSharedMainThreadContextProvider(); | 936 compositor_deps_->GetSharedMainThreadContextProvider(); |
938 // provider can be NULL after the GPU process crashed enough times and we | 937 // provider can be NULL after the GPU process crashed enough times and we |
939 // don't want to restart it any more (falling back to software). | 938 // don't want to restart it any more (falling back to software). |
940 if (!provider) | 939 if (!provider) |
941 return; | 940 return; |
942 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 941 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
943 } | 942 } |
944 | 943 |
945 } // namespace content | 944 } // namespace content |
OLD | NEW |