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

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: rebase on TOT Created 6 years, 10 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_host_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698