OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 current_priority_cutoff_value_(0) { | 95 current_priority_cutoff_value_(0) { |
96 media::InitializeMediaLibraryForTesting(); | 96 media::InitializeMediaLibraryForTesting(); |
97 } | 97 } |
98 | 98 |
99 LayerTreeSettings DefaultSettings() { | 99 LayerTreeSettings DefaultSettings() { |
100 LayerTreeSettings settings; | 100 LayerTreeSettings settings; |
101 settings.minimum_occlusion_tracking_size = gfx::Size(); | 101 settings.minimum_occlusion_tracking_size = gfx::Size(); |
102 settings.impl_side_painting = true; | 102 settings.impl_side_painting = true; |
103 settings.texture_id_allocation_chunk_size = 1; | 103 settings.texture_id_allocation_chunk_size = 1; |
104 settings.report_overscroll_only_for_scrollable_axes = true; | 104 settings.report_overscroll_only_for_scrollable_axes = true; |
| 105 settings.use_pinch_virtual_viewport = true; |
105 return settings; | 106 return settings; |
106 } | 107 } |
107 | 108 |
108 virtual void SetUp() override { | 109 virtual void SetUp() override { |
109 CreateHostImpl(DefaultSettings(), CreateOutputSurface()); | 110 CreateHostImpl(DefaultSettings(), CreateOutputSurface()); |
110 } | 111 } |
111 | 112 |
112 virtual void TearDown() override {} | 113 virtual void TearDown() override {} |
113 | 114 |
114 virtual void UpdateRendererCapabilitiesOnImplThread() override {} | 115 virtual void UpdateRendererCapabilitiesOnImplThread() override {} |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 | 817 |
817 // Trying to scroll with a vertical scrollbar will succeed. | 818 // Trying to scroll with a vertical scrollbar will succeed. |
818 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( | 819 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( |
819 gfx::Point(), SCROLL_FORWARD)); | 820 gfx::Point(), SCROLL_FORWARD)); |
820 EXPECT_FLOAT_EQ(875.f, | 821 EXPECT_FLOAT_EQ(875.f, |
821 host_impl_->InnerViewportScrollLayer()->ScrollDelta().y()); | 822 host_impl_->InnerViewportScrollLayer()->ScrollDelta().y()); |
822 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( | 823 EXPECT_TRUE(host_impl_->ScrollVerticallyByPage( |
823 gfx::Point(), SCROLL_BACKWARD)); | 824 gfx::Point(), SCROLL_BACKWARD)); |
824 } | 825 } |
825 | 826 |
826 // The user-scrollability breaks for zoomed-in pages. So disable this. | 827 TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) { |
827 // http://crbug.com/322223 | |
828 TEST_F(LayerTreeHostImplTest, DISABLED_ScrollWithUserUnscrollableLayers) { | |
829 LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(200, 200)); | 828 LayerImpl* scroll_layer = SetupScrollAndContentsLayers(gfx::Size(200, 200)); |
830 host_impl_->SetViewportSize(gfx::Size(100, 100)); | 829 host_impl_->SetViewportSize(gfx::Size(100, 100)); |
831 | 830 |
832 gfx::Size overflow_size(400, 400); | 831 gfx::Size overflow_size(400, 400); |
833 ASSERT_EQ(1u, scroll_layer->children().size()); | 832 ASSERT_EQ(1u, scroll_layer->children().size()); |
834 LayerImpl* overflow = scroll_layer->children()[0]; | 833 LayerImpl* overflow = scroll_layer->children()[0]; |
835 overflow->SetBounds(overflow_size); | 834 overflow->SetBounds(overflow_size); |
836 overflow->SetContentBounds(overflow_size); | 835 overflow->SetContentBounds(overflow_size); |
837 overflow->SetScrollClipLayer(scroll_layer->parent()->id()); | 836 overflow->SetScrollClipLayer(scroll_layer->parent()->id()); |
838 overflow->SetScrollOffset(gfx::ScrollOffset()); | 837 overflow->SetScrollOffset(gfx::ScrollOffset()); |
(...skipping 6428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7267 // surface. | 7266 // surface. |
7268 EXPECT_EQ(0, num_lost_surfaces_); | 7267 EXPECT_EQ(0, num_lost_surfaces_); |
7269 host_impl_->DidLoseOutputSurface(); | 7268 host_impl_->DidLoseOutputSurface(); |
7270 EXPECT_EQ(1, num_lost_surfaces_); | 7269 EXPECT_EQ(1, num_lost_surfaces_); |
7271 host_impl_->DidLoseOutputSurface(); | 7270 host_impl_->DidLoseOutputSurface(); |
7272 EXPECT_LE(1, num_lost_surfaces_); | 7271 EXPECT_LE(1, num_lost_surfaces_); |
7273 } | 7272 } |
7274 | 7273 |
7275 } // namespace | 7274 } // namespace |
7276 } // namespace cc | 7275 } // namespace cc |
OLD | NEW |