Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2216203002: Refactor MutatorHostClient from LayerTreeHost to LayerTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on another LTH refactor CL. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 const base::WeakPtr<cc::InputHandler>& 608 const base::WeakPtr<cc::InputHandler>&
609 RenderWidgetCompositor::GetInputHandler() { 609 RenderWidgetCompositor::GetInputHandler() {
610 return layer_tree_host_->GetInputHandler(); 610 return layer_tree_host_->GetInputHandler();
611 } 611 }
612 612
613 bool RenderWidgetCompositor::BeginMainFrameRequested() const { 613 bool RenderWidgetCompositor::BeginMainFrameRequested() const {
614 return layer_tree_host_->BeginMainFrameRequested(); 614 return layer_tree_host_->BeginMainFrameRequested();
615 } 615 }
616 616
617 void RenderWidgetCompositor::SetNeedsDisplayOnAllLayers() { 617 void RenderWidgetCompositor::SetNeedsDisplayOnAllLayers() {
618 layer_tree_host_->SetNeedsDisplayOnAllLayers(); 618 layer_tree_host_->GetLayerTree()->SetNeedsDisplayOnAllLayers();
619 } 619 }
620 620
621 void RenderWidgetCompositor::SetRasterizeOnlyVisibleContent() { 621 void RenderWidgetCompositor::SetRasterizeOnlyVisibleContent() {
622 cc::LayerTreeDebugState current = layer_tree_host_->debug_state(); 622 cc::LayerTreeDebugState current = layer_tree_host_->debug_state();
623 current.rasterize_only_visible_content = true; 623 current.rasterize_only_visible_content = true;
624 layer_tree_host_->SetDebugState(current); 624 layer_tree_host_->SetDebugState(current);
625 } 625 }
626 626
627 void RenderWidgetCompositor::SetNeedsRedrawRect(gfx::Rect damage_rect) { 627 void RenderWidgetCompositor::SetNeedsRedrawRect(gfx::Rect damage_rect) {
628 layer_tree_host_->SetNeedsRedrawRect(damage_rect); 628 layer_tree_host_->SetNeedsRedrawRect(damage_rect);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 layer_tree_host_->GetLayerTree()->SetRootLayer( 684 layer_tree_host_->GetLayerTree()->SetRootLayer(
685 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer()); 685 static_cast<const cc_blink::WebLayerImpl*>(&layer)->layer());
686 } 686 }
687 687
688 void RenderWidgetCompositor::clearRootLayer() { 688 void RenderWidgetCompositor::clearRootLayer() {
689 layer_tree_host_->GetLayerTree()->SetRootLayer(scoped_refptr<cc::Layer>()); 689 layer_tree_host_->GetLayerTree()->SetRootLayer(scoped_refptr<cc::Layer>());
690 } 690 }
691 691
692 void RenderWidgetCompositor::attachCompositorAnimationTimeline( 692 void RenderWidgetCompositor::attachCompositorAnimationTimeline(
693 cc::AnimationTimeline* compositor_timeline) { 693 cc::AnimationTimeline* compositor_timeline) {
694 DCHECK(layer_tree_host_->animation_host()); 694 cc::AnimationHost* animation_host =
695 layer_tree_host_->animation_host()->AddAnimationTimeline(compositor_timeline); 695 layer_tree_host_->GetLayerTree()->animation_host();
696 DCHECK(animation_host);
697 animation_host->AddAnimationTimeline(compositor_timeline);
696 } 698 }
697 699
698 void RenderWidgetCompositor::detachCompositorAnimationTimeline( 700 void RenderWidgetCompositor::detachCompositorAnimationTimeline(
699 cc::AnimationTimeline* compositor_timeline) { 701 cc::AnimationTimeline* compositor_timeline) {
700 DCHECK(layer_tree_host_->animation_host()); 702 cc::AnimationHost* animation_host =
701 layer_tree_host_->animation_host()->RemoveAnimationTimeline( 703 layer_tree_host_->GetLayerTree()->animation_host();
702 compositor_timeline); 704 DCHECK(animation_host);
705 animation_host->RemoveAnimationTimeline(compositor_timeline);
703 } 706 }
704 707
705 void RenderWidgetCompositor::setViewportSize( 708 void RenderWidgetCompositor::setViewportSize(
706 const WebSize& device_viewport_size) { 709 const WebSize& device_viewport_size) {
707 layer_tree_host_->GetLayerTree()->SetViewportSize(device_viewport_size); 710 layer_tree_host_->GetLayerTree()->SetViewportSize(device_viewport_size);
708 } 711 }
709 712
710 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom( 713 WebFloatPoint RenderWidgetCompositor::adjustEventPointForPinchZoom(
711 const WebFloatPoint& point) const { 714 const WebFloatPoint& point) const {
712 return point; 715 return point;
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 1149
1147 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); 1150 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized));
1148 } 1151 }
1149 1152
1150 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( 1153 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor(
1151 float device_scale) { 1154 float device_scale) {
1152 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale); 1155 layer_tree_host_->GetLayerTree()->SetPaintedDeviceScaleFactor(device_scale);
1153 } 1156 }
1154 1157
1155 } // namespace content 1158 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698