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 <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 665 |
666 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { | 666 void RenderWidgetCompositor::setRootLayer(const blink::WebLayer& layer) { |
667 layer_tree_host_->GetLayerTree()->SetRootLayer( | 667 layer_tree_host_->GetLayerTree()->SetRootLayer( |
668 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); | 668 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); |
669 } | 669 } |
670 | 670 |
671 void RenderWidgetCompositor::clearRootLayer() { | 671 void RenderWidgetCompositor::clearRootLayer() { |
672 layer_tree_host_->GetLayerTree()->SetRootLayer(scoped_refptr<cc::Layer>()); | 672 layer_tree_host_->GetLayerTree()->SetRootLayer(scoped_refptr<cc::Layer>()); |
673 } | 673 } |
674 | 674 |
675 void RenderWidgetCompositor::attachCompositorAnimationTimeline( | 675 cc::AnimationHost* RenderWidgetCompositor::compositorAnimationHost() { |
676 cc::AnimationTimeline* compositor_timeline) { | 676 return animation_host_.get(); |
677 DCHECK(animation_host_); | |
678 DCHECK(compositor_deps_->IsThreadedAnimationEnabled()); | |
679 animation_host_->AddAnimationTimeline(compositor_timeline); | |
680 } | |
681 | |
682 void RenderWidgetCompositor::detachCompositorAnimationTimeline( | |
683 cc::AnimationTimeline* compositor_timeline) { | |
684 DCHECK(animation_host_); | |
685 DCHECK(compositor_deps_->IsThreadedAnimationEnabled()); | |
686 animation_host_->RemoveAnimationTimeline(compositor_timeline); | |
687 } | 677 } |
688 | 678 |
689 void RenderWidgetCompositor::setViewportSize( | 679 void RenderWidgetCompositor::setViewportSize( |
690 const WebSize& device_viewport_size) { | 680 const WebSize& device_viewport_size) { |
691 layer_tree_host_->GetLayerTree()->SetViewportSize(device_viewport_size); | 681 layer_tree_host_->GetLayerTree()->SetViewportSize(device_viewport_size); |
692 } | 682 } |
693 | 683 |
694 WebSize RenderWidgetCompositor::getViewportSize() const { | 684 WebSize RenderWidgetCompositor::getViewportSize() const { |
695 return layer_tree_host_->GetLayerTree()->device_viewport_size(); | 685 return layer_tree_host_->GetLayerTree()->device_viewport_size(); |
696 } | 686 } |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 float device_scale) { | 1131 float device_scale) { |
1142 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); | 1132 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); |
1143 } | 1133 } |
1144 | 1134 |
1145 void RenderWidgetCompositor::SetDeviceColorSpace( | 1135 void RenderWidgetCompositor::SetDeviceColorSpace( |
1146 const gfx::ColorSpace& color_space) { | 1136 const gfx::ColorSpace& color_space) { |
1147 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); | 1137 layer_tree_host_->GetLayerTree()->SetDeviceColorSpace(color_space); |
1148 } | 1138 } |
1149 | 1139 |
1150 } // namespace content | 1140 } // namespace content |
OLD | NEW |