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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2840433002: Move LayerImpl's bounds_delta to property trees (Closed)
Patch Set: Document ViewportBoundsDelta better Created 3 years, 8 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1938 ? active_tree_->bottom_controls_height() 1938 ? active_tree_->bottom_controls_height()
1939 : 0.f; 1939 : 0.f;
1940 delta_from_top_controls += 1940 delta_from_top_controls +=
1941 bottom_controls_layout_height - 1941 bottom_controls_layout_height -
1942 browser_controls_offset_manager_->ContentBottomOffset(); 1942 browser_controls_offset_manager_->ContentBottomOffset();
1943 1943
1944 // Adjust the viewport layers by shrinking/expanding the container to account 1944 // Adjust the viewport layers by shrinking/expanding the container to account
1945 // for changes in the size (e.g. browser controls) since the last resize from 1945 // for changes in the size (e.g. browser controls) since the last resize from
1946 // Blink. 1946 // Blink.
1947 gfx::Vector2dF amount_to_expand(0.f, delta_from_top_controls); 1947 gfx::Vector2dF amount_to_expand(0.f, delta_from_top_controls);
1948 inner_container->SetBoundsDelta(amount_to_expand); 1948 inner_container->SetViewportBoundsDelta(amount_to_expand);
1949 1949
1950 if (outer_container && !outer_container->BoundsForScrolling().IsEmpty()) { 1950 if (outer_container && !outer_container->BoundsForScrolling().IsEmpty()) {
1951 // Adjust the outer viewport container as well, since adjusting only the 1951 // Adjust the outer viewport container as well, since adjusting only the
1952 // inner may cause its bounds to exceed those of the outer, causing scroll 1952 // inner may cause its bounds to exceed those of the outer, causing scroll
1953 // clamping. 1953 // clamping.
1954 gfx::Vector2dF amount_to_expand_scaled = gfx::ScaleVector2d( 1954 gfx::Vector2dF amount_to_expand_scaled = gfx::ScaleVector2d(
1955 amount_to_expand, 1.f / active_tree_->min_page_scale_factor()); 1955 amount_to_expand, 1.f / active_tree_->min_page_scale_factor());
1956 outer_container->SetBoundsDelta(amount_to_expand_scaled); 1956 outer_container->SetViewportBoundsDelta(amount_to_expand_scaled);
1957 active_tree_->InnerViewportScrollLayer()->SetBoundsDelta( 1957 active_tree_->InnerViewportScrollLayer()->SetViewportBoundsDelta(
1958 amount_to_expand_scaled); 1958 amount_to_expand_scaled);
1959 1959
1960 anchor.ResetViewportToAnchoredPosition(); 1960 anchor.ResetViewportToAnchoredPosition();
1961 } 1961 }
1962 } 1962 }
1963 1963
1964 void LayerTreeHostImpl::SynchronouslyInitializeAllTiles() { 1964 void LayerTreeHostImpl::SynchronouslyInitializeAllTiles() {
1965 // Only valid for the single-threaded non-scheduled/synchronous case 1965 // Only valid for the single-threaded non-scheduled/synchronous case
1966 // using the zero copy raster worker pool. 1966 // using the zero copy raster worker pool.
1967 single_thread_synchronous_task_graph_runner_->RunUntilIdle(); 1967 single_thread_synchronous_task_graph_runner_->RunUntilIdle();
(...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after
4296 } 4296 }
4297 4297
4298 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { 4298 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) {
4299 if (is_wheel_scroll) 4299 if (is_wheel_scroll)
4300 has_scrolled_by_wheel_ = true; 4300 has_scrolled_by_wheel_ = true;
4301 else 4301 else
4302 has_scrolled_by_touch_ = true; 4302 has_scrolled_by_touch_ = true;
4303 } 4303 }
4304 4304
4305 } // namespace cc 4305 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698