Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 132163009: [#6]Pass gfx structs by const ref (gfx::Vector2d) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698