| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2645 // Starting an animation should cause tiling resolution to get set to the | 2645 // Starting an animation should cause tiling resolution to get set to the |
| 2646 // maximum animation scale factor. | 2646 // maximum animation scale factor. |
| 2647 animating_transform = true; | 2647 animating_transform = true; |
| 2648 maximum_animation_scale = 3.f; | 2648 maximum_animation_scale = 3.f; |
| 2649 contents_scale = 2.f; | 2649 contents_scale = 2.f; |
| 2650 | 2650 |
| 2651 SetContentsScaleOnBothLayers(contents_scale, device_scale, page_scale, | 2651 SetContentsScaleOnBothLayers(contents_scale, device_scale, page_scale, |
| 2652 maximum_animation_scale, | 2652 maximum_animation_scale, |
| 2653 starting_animation_scale, animating_transform); | 2653 starting_animation_scale, animating_transform); |
| 2654 EXPECT_BOTH_EQ(HighResTiling()->contents_scale_key(), 3.f); | 2654 EXPECT_BOTH_EQ(HighResTiling()->contents_scale_key(), 3.f); |
| 2655 EXPECT_BOTH_TRUE(GetRasterSource()->ShouldAttemptToUseDistanceFieldText()); | |
| 2656 | 2655 |
| 2657 // Further changes to scale during the animation should not cause a new | 2656 // Further changes to scale during the animation should not cause a new |
| 2658 // high-res tiling to get created. | 2657 // high-res tiling to get created. |
| 2659 contents_scale = 4.f; | 2658 contents_scale = 4.f; |
| 2660 maximum_animation_scale = 5.f; | 2659 maximum_animation_scale = 5.f; |
| 2661 | 2660 |
| 2662 SetContentsScaleOnBothLayers(contents_scale, device_scale, page_scale, | 2661 SetContentsScaleOnBothLayers(contents_scale, device_scale, page_scale, |
| 2663 maximum_animation_scale, | 2662 maximum_animation_scale, |
| 2664 starting_animation_scale, animating_transform); | 2663 starting_animation_scale, animating_transform); |
| 2665 EXPECT_BOTH_EQ(HighResTiling()->contents_scale_key(), 3.f); | 2664 EXPECT_BOTH_EQ(HighResTiling()->contents_scale_key(), 3.f); |
| (...skipping 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5021 EXPECT_FLOAT_EQ(expected_contents_scale, | 5020 EXPECT_FLOAT_EQ(expected_contents_scale, |
| 5022 pending_layer_ptr->picture_layer_tiling_set() | 5021 pending_layer_ptr->picture_layer_tiling_set() |
| 5023 ->FindTilingWithResolution(HIGH_RESOLUTION) | 5022 ->FindTilingWithResolution(HIGH_RESOLUTION) |
| 5024 ->contents_scale_key()) | 5023 ->contents_scale_key()) |
| 5025 << "ideal_contents_scale: " << ideal_contents_scale; | 5024 << "ideal_contents_scale: " << ideal_contents_scale; |
| 5026 } | 5025 } |
| 5027 } | 5026 } |
| 5028 | 5027 |
| 5029 } // namespace | 5028 } // namespace |
| 5030 } // namespace cc | 5029 } // namespace cc |
| OLD | NEW |