diff options
-rw-r--r-- | cc/layers/contents_scaling_layer.cc | 4 | ||||
-rw-r--r-- | cc/layers/contents_scaling_layer.h | 4 | ||||
-rw-r--r-- | cc/layers/image_layer.cc | 4 | ||||
-rw-r--r-- | cc/layers/image_layer.h | 4 | ||||
-rw-r--r-- | cc/layers/layer.cc | 4 | ||||
-rw-r--r-- | cc/layers/layer.h | 4 | ||||
-rw-r--r-- | cc/layers/painted_scrollbar_layer.cc | 8 | ||||
-rw-r--r-- | cc/layers/painted_scrollbar_layer.h | 4 | ||||
-rw-r--r-- | cc/test/tiled_layer_test_common.cc | 8 | ||||
-rw-r--r-- | cc/test/tiled_layer_test_common.h | 4 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_common.cc | 46 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_common_unittest.cc | 64 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 8 |
13 files changed, 17 insertions, 149 deletions
diff --git a/cc/layers/contents_scaling_layer.cc b/cc/layers/contents_scaling_layer.cc index a53482a..5811bdc 100644 --- a/cc/layers/contents_scaling_layer.cc +++ b/cc/layers/contents_scaling_layer.cc @@ -22,10 +22,6 @@ ContentsScalingLayer::~ContentsScalingLayer() { void ContentsScalingLayer::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) { diff --git a/cc/layers/contents_scaling_layer.h b/cc/layers/contents_scaling_layer.h index 3e95962..84780d2 100644 --- a/cc/layers/contents_scaling_layer.h +++ b/cc/layers/contents_scaling_layer.h @@ -15,10 +15,6 @@ namespace cc { class CC_EXPORT ContentsScalingLayer : public Layer { public: 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; diff --git a/cc/layers/image_layer.cc b/cc/layers/image_layer.cc index cada84d..edcf1dc 100644 --- a/cc/layers/image_layer.cc +++ b/cc/layers/image_layer.cc @@ -65,10 +65,6 @@ LayerUpdater* ImageLayer::Updater() const { } void ImageLayer::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) { diff --git a/cc/layers/image_layer.h b/cc/layers/image_layer.h index 2f3255f..a3cee58 100644 --- a/cc/layers/image_layer.h +++ b/cc/layers/image_layer.h @@ -25,10 +25,6 @@ class CC_EXPORT ImageLayer : public TiledLayer { virtual bool Update(ResourceUpdateQueue* queue, const OcclusionTracker<Layer>* occlusion) 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; diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 8722aa6..2367e52 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc @@ -396,10 +396,6 @@ SkColor Layer::SafeOpaqueBackgroundColor() const { } void Layer::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) { diff --git a/cc/layers/layer.h b/cc/layers/layer.h index ab897a8..822b16d 100644 --- a/cc/layers/layer.h +++ b/cc/layers/layer.h @@ -381,10 +381,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, gfx::Size content_bounds() const { return draw_properties_.content_bounds; } 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); diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc index 3764689..c0b2a72 100644 --- a/cc/layers/painted_scrollbar_layer.cc +++ b/cc/layers/painted_scrollbar_layer.cc @@ -98,19 +98,11 @@ float PaintedScrollbarLayer::ClampScaleToMaxTextureSize(float scale) { void PaintedScrollbarLayer::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) { ContentsScalingLayer::CalculateContentsScale( ClampScaleToMaxTextureSize(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); diff --git a/cc/layers/painted_scrollbar_layer.h b/cc/layers/painted_scrollbar_layer.h index d684d32..cd6a046 100644 --- a/cc/layers/painted_scrollbar_layer.h +++ b/cc/layers/painted_scrollbar_layer.h @@ -43,10 +43,6 @@ class CC_EXPORT PaintedScrollbarLayer : public ScrollbarLayerInterface, virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; virtual void PushScrollClipPropertiesTo(LayerImpl* layer) 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; diff --git a/cc/test/tiled_layer_test_common.cc b/cc/test/tiled_layer_test_common.cc index cd4f9bd..81975ca 100644 --- a/cc/test/tiled_layer_test_common.cc +++ b/cc/test/tiled_layer_test_common.cc @@ -114,10 +114,6 @@ PrioritizedResourceManager* FakeTiledLayer::ResourceManager() { void FakeTiledLayer::UpdateContentsScale(float ideal_contents_scale) { CalculateContentsScale(ideal_contents_scale, - 1.f, - 1.f, - 1.f, - false, // animating_transform_to_screen &draw_properties().contents_scale_x, &draw_properties().contents_scale_y, &draw_properties().content_bounds); @@ -155,10 +151,6 @@ void FakeTiledLayerWithScaledBounds::SetContentBounds( void FakeTiledLayerWithScaledBounds::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) { diff --git a/cc/test/tiled_layer_test_common.h b/cc/test/tiled_layer_test_common.h index d407f6b..f7e0158 100644 --- a/cc/test/tiled_layer_test_common.h +++ b/cc/test/tiled_layer_test_common.h @@ -140,10 +140,6 @@ class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { void SetContentBounds(const gfx::Size& content_bounds); 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; diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc index 3bbbf63..51fb080 100644 --- a/cc/trees/layer_tree_host_common.cc +++ b/cc/trees/layer_tree_host_common.cc @@ -932,29 +932,14 @@ static inline void UpdateLayerScaleDrawProperties( layer->draw_properties().device_scale_factor = device_scale_factor; } -static inline void CalculateContentsScale( - LayerImpl* layer, - float contents_scale, - float device_scale_factor, - float page_scale_factor, - float maximum_animation_contents_scale, - bool animating_transform_to_screen) { +static inline void CalculateContentsScale(LayerImpl* layer, + float contents_scale) { // LayerImpl has all of its content scales and bounds pushed from the Main // thread during commit and just uses those values as-is. } -static inline void CalculateContentsScale( - Layer* layer, - float contents_scale, - float device_scale_factor, - float page_scale_factor, - float maximum_animation_contents_scale, - bool animating_transform_to_screen) { +static inline void CalculateContentsScale(Layer* layer, float contents_scale) { layer->CalculateContentsScale(contents_scale, - device_scale_factor, - page_scale_factor, - maximum_animation_contents_scale, - animating_transform_to_screen, &layer->draw_properties().contents_scale_x, &layer->draw_properties().contents_scale_y, &layer->draw_properties().content_bounds); @@ -963,10 +948,6 @@ static inline void CalculateContentsScale( if (mask_layer) { mask_layer->CalculateContentsScale( contents_scale, - device_scale_factor, - page_scale_factor, - maximum_animation_contents_scale, - animating_transform_to_screen, &mask_layer->draw_properties().contents_scale_x, &mask_layer->draw_properties().contents_scale_y, &mask_layer->draw_properties().content_bounds); @@ -977,10 +958,6 @@ static inline void CalculateContentsScale( if (replica_mask_layer) { replica_mask_layer->CalculateContentsScale( contents_scale, - device_scale_factor, - page_scale_factor, - maximum_animation_contents_scale, - animating_transform_to_screen, &replica_mask_layer->draw_properties().contents_scale_x, &replica_mask_layer->draw_properties().contents_scale_y, &replica_mask_layer->draw_properties().content_bounds); @@ -993,14 +970,8 @@ static inline void UpdateLayerContentsScale( float ideal_contents_scale, float device_scale_factor, float page_scale_factor, - float maximum_animation_contents_scale, bool animating_transform_to_screen) { - CalculateContentsScale(layer, - ideal_contents_scale, - device_scale_factor, - page_scale_factor, - maximum_animation_contents_scale, - animating_transform_to_screen); + CalculateContentsScale(layer, ideal_contents_scale); } static inline void UpdateLayerContentsScale( @@ -1009,7 +980,6 @@ static inline void UpdateLayerContentsScale( float ideal_contents_scale, float device_scale_factor, float page_scale_factor, - float maximum_animation_contents_scale, bool animating_transform_to_screen) { if (can_adjust_raster_scale) { float ideal_raster_scale = @@ -1042,12 +1012,7 @@ static inline void UpdateLayerContentsScale( float old_contents_scale_y = layer->contents_scale_y(); float contents_scale = raster_scale * device_scale_factor * page_scale_factor; - CalculateContentsScale(layer, - contents_scale, - device_scale_factor, - page_scale_factor, - maximum_animation_contents_scale, - animating_transform_to_screen); + CalculateContentsScale(layer, contents_scale); if (layer->content_bounds() != old_content_bounds || layer->contents_scale_x() != old_contents_scale_x || @@ -1781,7 +1746,6 @@ static void CalculateDrawPropertiesInternal( data_from_ancestor.in_subtree_of_page_scale_application_layer ? globals.page_scale_factor : 1.f, - combined_maximum_animation_contents_scale, animating_transform_to_screen); UpdateLayerScaleDrawProperties( diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index 8dcb6d7..6429e81 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); diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index ea806aa..94383da 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -1050,19 +1050,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* contentBounds) OVERRIDE { // Skip over the ContentLayer's method 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, contentBounds); |