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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 171 } |
172 | 172 |
173 static void ExpectClearedScrollDeltasRecursive(LayerImpl* layer) { | 173 static void ExpectClearedScrollDeltasRecursive(LayerImpl* layer) { |
174 ASSERT_EQ(layer->ScrollDelta(), gfx::Vector2d()); | 174 ASSERT_EQ(layer->ScrollDelta(), gfx::Vector2d()); |
175 for (size_t i = 0; i < layer->children().size(); ++i) | 175 for (size_t i = 0; i < layer->children().size(); ++i) |
176 ExpectClearedScrollDeltasRecursive(layer->children()[i]); | 176 ExpectClearedScrollDeltasRecursive(layer->children()[i]); |
177 } | 177 } |
178 | 178 |
179 static void ExpectContains(const ScrollAndScaleSet& scroll_info, | 179 static void ExpectContains(const ScrollAndScaleSet& scroll_info, |
180 int id, | 180 int id, |
181 gfx::Vector2d scroll_delta) { | 181 const gfx::Vector2d& scroll_delta) { |
182 int times_encountered = 0; | 182 int times_encountered = 0; |
183 | 183 |
184 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) { | 184 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) { |
185 if (scroll_info.scrolls[i].layer_id != id) | 185 if (scroll_info.scrolls[i].layer_id != id) |
186 continue; | 186 continue; |
187 EXPECT_VECTOR_EQ(scroll_delta, scroll_info.scrolls[i].scroll_delta); | 187 EXPECT_VECTOR_EQ(scroll_delta, scroll_info.scrolls[i].scroll_delta); |
188 times_encountered++; | 188 times_encountered++; |
189 } | 189 } |
190 | 190 |
191 ASSERT_EQ(1, times_encountered); | 191 ASSERT_EQ(1, times_encountered); |
(...skipping 5261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5453 &set_needs_redraw_count)); | 5453 &set_needs_redraw_count)); |
5454 // Empty damage rect won't signal the monitor. | 5454 // Empty damage rect won't signal the monitor. |
5455 host_impl_->SetNeedsRedrawRect(gfx::Rect()); | 5455 host_impl_->SetNeedsRedrawRect(gfx::Rect()); |
5456 EXPECT_EQ(0, set_needs_commit_count); | 5456 EXPECT_EQ(0, set_needs_commit_count); |
5457 EXPECT_EQ(2, set_needs_redraw_count); | 5457 EXPECT_EQ(2, set_needs_redraw_count); |
5458 } | 5458 } |
5459 } | 5459 } |
5460 | 5460 |
5461 } // namespace | 5461 } // namespace |
5462 } // namespace cc | 5462 } // namespace cc |
OLD | NEW |