| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 172 } |
| 173 | 173 |
| 174 static void ExpectClearedScrollDeltasRecursive(LayerImpl* layer) { | 174 static void ExpectClearedScrollDeltasRecursive(LayerImpl* layer) { |
| 175 ASSERT_EQ(layer->ScrollDelta(), gfx::Vector2d()); | 175 ASSERT_EQ(layer->ScrollDelta(), gfx::Vector2d()); |
| 176 for (size_t i = 0; i < layer->children().size(); ++i) | 176 for (size_t i = 0; i < layer->children().size(); ++i) |
| 177 ExpectClearedScrollDeltasRecursive(layer->children()[i]); | 177 ExpectClearedScrollDeltasRecursive(layer->children()[i]); |
| 178 } | 178 } |
| 179 | 179 |
| 180 static void ExpectContains(const ScrollAndScaleSet& scroll_info, | 180 static void ExpectContains(const ScrollAndScaleSet& scroll_info, |
| 181 int id, | 181 int id, |
| 182 gfx::Vector2d scroll_delta) { | 182 const gfx::Vector2d& scroll_delta) { |
| 183 int times_encountered = 0; | 183 int times_encountered = 0; |
| 184 | 184 |
| 185 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) { | 185 for (size_t i = 0; i < scroll_info.scrolls.size(); ++i) { |
| 186 if (scroll_info.scrolls[i].layer_id != id) | 186 if (scroll_info.scrolls[i].layer_id != id) |
| 187 continue; | 187 continue; |
| 188 EXPECT_VECTOR_EQ(scroll_delta, scroll_info.scrolls[i].scroll_delta); | 188 EXPECT_VECTOR_EQ(scroll_delta, scroll_info.scrolls[i].scroll_delta); |
| 189 times_encountered++; | 189 times_encountered++; |
| 190 } | 190 } |
| 191 | 191 |
| 192 ASSERT_EQ(1, times_encountered); | 192 ASSERT_EQ(1, times_encountered); |
| (...skipping 5575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5768 &set_needs_redraw_count)); | 5768 &set_needs_redraw_count)); |
| 5769 // Empty damage rect won't signal the monitor. | 5769 // Empty damage rect won't signal the monitor. |
| 5770 host_impl_->SetNeedsRedrawRect(gfx::Rect()); | 5770 host_impl_->SetNeedsRedrawRect(gfx::Rect()); |
| 5771 EXPECT_EQ(0, set_needs_commit_count); | 5771 EXPECT_EQ(0, set_needs_commit_count); |
| 5772 EXPECT_EQ(2, set_needs_redraw_count); | 5772 EXPECT_EQ(2, set_needs_redraw_count); |
| 5773 } | 5773 } |
| 5774 } | 5774 } |
| 5775 | 5775 |
| 5776 } // namespace | 5776 } // namespace |
| 5777 } // namespace cc | 5777 } // namespace cc |
| OLD | NEW |