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

Unified Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2929873002: Shifting layer position for sticky element to avoid passing unnessary variable to cc (Closed)
Patch Set: Bug fix Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl_test_properties.h ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common_unittest.cc
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc
index cb43d5ffc45b87ccf591c00d4cbd01bbcca22b8d..b165db406d9ef944f019e59d162e8cd90b1b5c45 100644
--- a/cc/trees/layer_tree_host_common_unittest.cc
+++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -6879,7 +6879,6 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionMainThreadUpdates) {
sticky_position.scroll_container_relative_containing_block_rect =
gfx::Rect(0, 0, 50, 50);
sticky_pos->SetStickyPositionConstraint(sticky_position);
- sticky_pos->SetElementId(LayerIdToElementIdForTesting(sticky_pos->id()));
root->SetBounds(gfx::Size(100, 100));
container->SetBounds(gfx::Size(100, 100));
@@ -6919,8 +6918,8 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionMainThreadUpdates) {
// Now the main thread commits the new position of the sticky element.
scroller->SetScrollOffset(gfx::ScrollOffset(15, 15));
- sticky_pos->SetPosition(gfx::PointF(10, 25));
- sticky_pos->SetOffsetForStickyPositionFromMainThread(gfx::Size(0, 5));
+ // Shift the layer by -offset_for_position_sticky.
+ sticky_pos->SetPosition(gfx::PointF(10, 25) - gfx::Vector2dF(0, 5));
ExecuteCalculateDrawProperties(root.get());
host()->host_impl()->CreatePendingTree();
host()->CommitAndCreatePendingTree();
@@ -6973,7 +6972,6 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionCompositedContainer) {
sticky_position.scroll_container_relative_containing_block_rect =
gfx::Rect(20, 20, 30, 30);
sticky_pos->SetStickyPositionConstraint(sticky_position);
- sticky_pos->SetElementId(LayerIdToElementIdForTesting(sticky_pos->id()));
root->SetBounds(gfx::Size(100, 100));
container->SetBounds(gfx::Size(100, 100));
@@ -7015,8 +7013,8 @@ TEST_F(LayerTreeHostCommonTest, StickyPositionCompositedContainer) {
// Now the main thread commits the new position of the sticky element.
scroller->SetScrollOffset(gfx::ScrollOffset(0, 25));
- sticky_pos->SetPosition(gfx::PointF(0, 15));
- sticky_pos->SetOffsetForStickyPositionFromMainThread(gfx::Size(0, 5));
+ // Shift the layer by -offset_for_position_sticky.
+ sticky_pos->SetPosition(gfx::PointF(0, 15) - gfx::Vector2dF(0, 5));
ExecuteCalculateDrawProperties(root.get());
host()->host_impl()->CreatePendingTree();
host()->CommitAndCreatePendingTree();
« no previous file with comments | « cc/layers/layer_impl_test_properties.h ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698