| 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 643 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()); | 665 layer_tree_host_->settings()); |
| 666 } | 666 } |
| 667 | 667 |
| 668 void RenderWidgetCompositor::registerViewportLayers( | 668 void RenderWidgetCompositor::registerViewportLayers( |
| 669 const blink::WebLayer* overscrollElasticityLayer, | 669 const blink::WebLayer* overscrollElasticityLayer, |
| 670 const blink::WebLayer* pageScaleLayer, | 670 const blink::WebLayer* pageScaleLayer, |
| 671 const blink::WebLayer* innerViewportScrollLayer, | 671 const blink::WebLayer* innerViewportScrollLayer, |
| 672 const blink::WebLayer* outerViewportScrollLayer) { | 672 const blink::WebLayer* outerViewportScrollLayer) { |
| 673 layer_tree_host_->RegisterViewportLayers( | 673 layer_tree_host_->RegisterViewportLayers( |
| 674 // The scroll elasticity layer will only exist when using pinch virtual | 674 // The scroll elasticity layer will only exist when using pinch virtual |
| 675 // viewports. | 675 // viewports. |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 cc::ContextProvider* provider = | 936 cc::ContextProvider* provider = |
| 937 compositor_deps_->GetSharedMainThreadContextProvider(); | 937 compositor_deps_->GetSharedMainThreadContextProvider(); |
| 938 // provider can be NULL after the GPU process crashed enough times and we | 938 // 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). | 939 // don't want to restart it any more (falling back to software). |
| 940 if (!provider) | 940 if (!provider) |
| 941 return; | 941 return; |
| 942 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); | 942 provider->ContextGL()->RateLimitOffscreenContextCHROMIUM(); |
| 943 } | 943 } |
| 944 | 944 |
| 945 } // namespace content | 945 } // namespace content |
| OLD | NEW |