Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
cc: Fix bug where tabs have the wrong scale factor
Browse files Browse the repository at this point in the history
Device scale factor impacts the draw properties (in particular, the
transforms of the TransformNodes in the property tree). So, mark that
draw properties need to be updated when device scale factor changes.

BUG=567832
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1633043004

Cr-Commit-Position: refs/heads/master@{#371659}
  • Loading branch information
ccameron-chromium authored and Commit bot committed Jan 27, 2016
1 parent aeb109f commit a65c79b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions cc/trees/layer_tree_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ void LayerTreeImpl::SetDeviceScaleFactor(float device_scale_factor) {
return;
device_scale_factor_ = device_scale_factor;

set_needs_update_draw_properties();
if (IsActiveTree())
layer_tree_host_impl_->SetFullRootLayerDamage();
}
Expand Down
8 changes: 8 additions & 0 deletions cc/trees/layer_tree_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2370,5 +2370,13 @@ TEST_F(LayerTreeImplTest, NumLayersSmallTree) {
EXPECT_EQ(4u, host_impl().active_tree()->NumLayers());
}

TEST_F(LayerTreeImplTest, DeviceScaleFactorNeedsDrawPropertiesUpdate) {
host_impl().active_tree()->SetDeviceScaleFactor(1.f);
host_impl().active_tree()->UpdateDrawProperties(false);
EXPECT_FALSE(host_impl().active_tree()->needs_update_draw_properties());
host_impl().active_tree()->SetDeviceScaleFactor(2.f);
EXPECT_TRUE(host_impl().active_tree()->needs_update_draw_properties());
}

} // namespace
} // namespace cc

0 comments on commit a65c79b

Please sign in to comment.