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

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

Issue 2113483002: Make RootScroller set the outer viewport scroll layer in the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 775
776 void RenderWidgetCompositor::registerViewportLayers( 776 void RenderWidgetCompositor::registerViewportLayers(
777 const blink::WebLayer* overscrollElasticityLayer, 777 const blink::WebLayer* overscrollElasticityLayer,
778 const blink::WebLayer* pageScaleLayer, 778 const blink::WebLayer* pageScaleLayer,
779 const blink::WebLayer* innerViewportScrollLayer, 779 const blink::WebLayer* innerViewportScrollLayer,
780 const blink::WebLayer* outerViewportScrollLayer) { 780 const blink::WebLayer* outerViewportScrollLayer) {
781 layer_tree_host_->RegisterViewportLayers( 781 layer_tree_host_->RegisterViewportLayers(
782 // TODO(bokan): This check can probably be removed now, but it looks 782 // TODO(bokan): This check can probably be removed now, but it looks
783 // like overscroll elasticity may still be NULL until VisualViewport 783 // like overscroll elasticity may still be NULL until VisualViewport
784 // registers its layers. 784 // registers its layers.
785 // The scroll elasticity layer will only exist when using pinch virtual
786 // viewports.
787 overscrollElasticityLayer 785 overscrollElasticityLayer
788 ? static_cast<const cc_blink::WebLayerImpl*>( 786 ? static_cast<const cc_blink::WebLayerImpl*>(
789 overscrollElasticityLayer)->layer() 787 overscrollElasticityLayer)->layer()
790 : NULL, 788 : NULL,
791 static_cast<const cc_blink::WebLayerImpl*>(pageScaleLayer)->layer(), 789 static_cast<const cc_blink::WebLayerImpl*>(pageScaleLayer)->layer(),
792 static_cast<const cc_blink::WebLayerImpl*>(innerViewportScrollLayer) 790 static_cast<const cc_blink::WebLayerImpl*>(innerViewportScrollLayer)
793 ->layer(), 791 ->layer(),
794 // TODO(bokan): This check can probably be removed now, but it looks 792 // TODO(bokan): This check can probably be removed now, but it looks
795 // like overscroll elasticity may still be NULL until VisualViewport 793 // like outer viewport may still be NULL until VisualViewport
796 // registers its layers. 794 // registers its layers.
797 // The outer viewport layer will only exist when using pinch virtual
798 // viewports.
799 outerViewportScrollLayer 795 outerViewportScrollLayer
800 ? static_cast<const cc_blink::WebLayerImpl*>(outerViewportScrollLayer) 796 ? static_cast<const cc_blink::WebLayerImpl*>(outerViewportScrollLayer)
801 ->layer() 797 ->layer()
802 : NULL); 798 : NULL);
803 } 799 }
804 800
805 void RenderWidgetCompositor::clearViewportLayers() { 801 void RenderWidgetCompositor::clearViewportLayers() {
806 layer_tree_host_->RegisterViewportLayers( 802 layer_tree_host_->RegisterViewportLayers(
807 scoped_refptr<cc::Layer>(), scoped_refptr<cc::Layer>(), 803 scoped_refptr<cc::Layer>(), scoped_refptr<cc::Layer>(),
808 scoped_refptr<cc::Layer>(), scoped_refptr<cc::Layer>()); 804 scoped_refptr<cc::Layer>(), scoped_refptr<cc::Layer>());
809 } 805 }
810 806
807 void RenderWidgetCompositor::setRootScrollerLayer(
808 const blink::WebLayer* rootScrollerLayer) {
809 layer_tree_host_->SetRootScrollerLayer(rootScrollerLayer
810 ? static_cast<const cc_blink::WebLayerImpl*>(rootScrollerLayer)->layer()
811 : NULL);
812 }
813
811 void RenderWidgetCompositor::registerSelection( 814 void RenderWidgetCompositor::registerSelection(
812 const blink::WebSelection& selection) { 815 const blink::WebSelection& selection) {
813 layer_tree_host_->RegisterSelection(ConvertWebSelection(selection)); 816 layer_tree_host_->RegisterSelection(ConvertWebSelection(selection));
814 } 817 }
815 818
816 void RenderWidgetCompositor::clearSelection() { 819 void RenderWidgetCompositor::clearSelection() {
817 cc::LayerSelection empty_selection; 820 cc::LayerSelection empty_selection;
818 layer_tree_host_->RegisterSelection(empty_selection); 821 layer_tree_host_->RegisterSelection(empty_selection);
819 } 822 }
820 823
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 1147
1145 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized)); 1148 remote_proto_channel_receiver_->OnProtoReceived(std::move(deserialized));
1146 } 1149 }
1147 1150
1148 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor( 1151 void RenderWidgetCompositor::SetPaintedDeviceScaleFactor(
1149 float device_scale) { 1152 float device_scale) {
1150 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale); 1153 layer_tree_host_->SetPaintedDeviceScaleFactor(device_scale);
1151 } 1154 }
1152 1155
1153 } // namespace content 1156 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698