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 8dcb6d7ad1ee45ed44ed7cbf7d581164a420e9d8..6429e81b46c15924dd4a22a519dd7bf19495bc47 100644 |
--- a/cc/trees/layer_tree_host_common_unittest.cc |
+++ b/cc/trees/layer_tree_host_common_unittest.cc |
@@ -38,49 +38,16 @@ namespace { |
class LayerWithForcedDrawsContent : public Layer { |
public: |
- LayerWithForcedDrawsContent() : Layer(), last_device_scale_factor_(0.f) {} |
+ LayerWithForcedDrawsContent() {} |
virtual bool DrawsContent() const OVERRIDE; |
- virtual void CalculateContentsScale(float ideal_contents_scale, |
- float device_scale_factor, |
- float page_scale_factor, |
- float maximum_animation_contents_scale, |
- bool animating_transform_to_screen, |
- float* contents_scale_x, |
- float* contents_scale_y, |
- gfx::Size* content_bounds) OVERRIDE; |
- |
- float last_device_scale_factor() const { return last_device_scale_factor_; } |
private: |
virtual ~LayerWithForcedDrawsContent() {} |
- |
- // Parameters from last CalculateContentsScale. |
- float last_device_scale_factor_; |
}; |
bool LayerWithForcedDrawsContent::DrawsContent() const { return true; } |
-void LayerWithForcedDrawsContent::CalculateContentsScale( |
- float ideal_contents_scale, |
- float device_scale_factor, |
- float page_scale_factor, |
- float maximum_animation_contents_scale, |
- bool animating_transform_to_screen, |
- float* contents_scale_x, |
- float* contents_scale_y, |
- gfx::Size* content_bounds) { |
- last_device_scale_factor_ = device_scale_factor; |
- Layer::CalculateContentsScale(ideal_contents_scale, |
- device_scale_factor, |
- page_scale_factor, |
- maximum_animation_contents_scale, |
- animating_transform_to_screen, |
- contents_scale_x, |
- contents_scale_y, |
- content_bounds); |
-} |
- |
class MockContentLayerClient : public ContentLayerClient { |
public: |
MockContentLayerClient() {} |
@@ -1198,8 +1165,8 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { |
EXPECT_EQ(translate, root->draw_properties().target_space_transform); |
EXPECT_EQ(translate, child->draw_properties().target_space_transform); |
EXPECT_EQ(identity_matrix, root->render_surface()->draw_transform()); |
- EXPECT_EQ(1.f, root->last_device_scale_factor()); |
- EXPECT_EQ(1.f, child->last_device_scale_factor()); |
+ EXPECT_EQ(1.f, root->draw_properties().device_scale_factor); |
+ EXPECT_EQ(1.f, child->draw_properties().device_scale_factor); |
} |
gfx::Transform scale; |
@@ -1213,8 +1180,8 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { |
EXPECT_EQ(scale, root->draw_properties().target_space_transform); |
EXPECT_EQ(scale, child->draw_properties().target_space_transform); |
EXPECT_EQ(identity_matrix, root->render_surface()->draw_transform()); |
- EXPECT_EQ(2.f, root->last_device_scale_factor()); |
- EXPECT_EQ(2.f, child->last_device_scale_factor()); |
+ EXPECT_EQ(2.f, root->draw_properties().device_scale_factor); |
+ EXPECT_EQ(2.f, child->draw_properties().device_scale_factor); |
} |
gfx::Transform rotate; |
@@ -1228,8 +1195,8 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { |
EXPECT_EQ(rotate, root->draw_properties().target_space_transform); |
EXPECT_EQ(rotate, child->draw_properties().target_space_transform); |
EXPECT_EQ(identity_matrix, root->render_surface()->draw_transform()); |
- EXPECT_EQ(1.f, root->last_device_scale_factor()); |
- EXPECT_EQ(1.f, child->last_device_scale_factor()); |
+ EXPECT_EQ(1.f, root->draw_properties().device_scale_factor); |
+ EXPECT_EQ(1.f, child->draw_properties().device_scale_factor); |
} |
gfx::Transform composite; |
@@ -1264,8 +1231,9 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { |
EXPECT_EQ(device_scaled_translate, |
child->draw_properties().target_space_transform); |
EXPECT_EQ(identity_matrix, root->render_surface()->draw_transform()); |
- EXPECT_EQ(device_scale_factor, root->last_device_scale_factor()); |
- EXPECT_EQ(device_scale_factor, child->last_device_scale_factor()); |
+ EXPECT_EQ(device_scale_factor, root->draw_properties().device_scale_factor); |
+ EXPECT_EQ(device_scale_factor, |
+ child->draw_properties().device_scale_factor); |
} |
// Verify it composes correctly with page scale. |
@@ -1285,8 +1253,8 @@ TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { |
EXPECT_EQ(page_scaled_translate, |
child->draw_properties().target_space_transform); |
EXPECT_EQ(identity_matrix, root->render_surface()->draw_transform()); |
- EXPECT_EQ(1.f, root->last_device_scale_factor()); |
- EXPECT_EQ(1.f, child->last_device_scale_factor()); |
+ EXPECT_EQ(1.f, root->draw_properties().device_scale_factor); |
+ EXPECT_EQ(1.f, child->draw_properties().device_scale_factor); |
} |
// Verify that it composes correctly with transforms directly on root layer. |
@@ -4049,19 +4017,11 @@ class NoScaleContentLayer : public ContentLayer { |
} |
virtual void CalculateContentsScale(float ideal_contents_scale, |
- float device_scale_factor, |
- float page_scale_factor, |
- float maximum_animation_contents_scale, |
- bool animating_transform_to_screen, |
float* contents_scale_x, |
float* contents_scale_y, |
gfx::Size* content_bounds) OVERRIDE { |
// Skip over the ContentLayer to the base Layer class. |
Layer::CalculateContentsScale(ideal_contents_scale, |
- device_scale_factor, |
- page_scale_factor, |
- maximum_animation_contents_scale, |
- animating_transform_to_screen, |
contents_scale_x, |
contents_scale_y, |
content_bounds); |