Commit a65c79bc authored by ccameron's avatar ccameron Committed by Commit bot

cc: Fix bug where tabs have the wrong scale factor

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}
parent aeb109ff
...@@ -599,6 +599,7 @@ void LayerTreeImpl::SetDeviceScaleFactor(float device_scale_factor) { ...@@ -599,6 +599,7 @@ void LayerTreeImpl::SetDeviceScaleFactor(float device_scale_factor) {
return; return;
device_scale_factor_ = device_scale_factor; device_scale_factor_ = device_scale_factor;
set_needs_update_draw_properties();
if (IsActiveTree()) if (IsActiveTree())
layer_tree_host_impl_->SetFullRootLayerDamage(); layer_tree_host_impl_->SetFullRootLayerDamage();
} }
......
...@@ -2370,5 +2370,13 @@ TEST_F(LayerTreeImplTest, NumLayersSmallTree) { ...@@ -2370,5 +2370,13 @@ TEST_F(LayerTreeImplTest, NumLayersSmallTree) {
EXPECT_EQ(4u, host_impl().active_tree()->NumLayers()); 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
} // namespace cc } // namespace cc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment