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

Side by Side Diff: cc/layers/layer_iterator_unittest.cc

Issue 12967018: cc: Avoid pointless gfx::Point/Size contructors when making Rects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RectFs as well Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/nine_patch_layer.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/layer_iterator.h" 5 #include "cc/layers/layer_iterator.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 #include "cc/trees/layer_tree_host_common.h" 8 #include "cc/trees/layer_tree_host_common.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 scoped_refptr<TestLayer> root2 = TestLayer::Create(); 222 scoped_refptr<TestLayer> root2 = TestLayer::Create();
223 scoped_refptr<TestLayer> root3 = TestLayer::Create(); 223 scoped_refptr<TestLayer> root3 = TestLayer::Create();
224 scoped_refptr<TestLayer> root21 = TestLayer::Create(); 224 scoped_refptr<TestLayer> root21 = TestLayer::Create();
225 scoped_refptr<TestLayer> root22 = TestLayer::Create(); 225 scoped_refptr<TestLayer> root22 = TestLayer::Create();
226 scoped_refptr<TestLayer> root23 = TestLayer::Create(); 226 scoped_refptr<TestLayer> root23 = TestLayer::Create();
227 scoped_refptr<TestLayer> root221 = TestLayer::Create(); 227 scoped_refptr<TestLayer> root221 = TestLayer::Create();
228 scoped_refptr<TestLayer> root231 = TestLayer::Create(); 228 scoped_refptr<TestLayer> root231 = TestLayer::Create();
229 229
230 root_layer->CreateRenderSurface(); 230 root_layer->CreateRenderSurface();
231 root_layer->render_surface()-> 231 root_layer->render_surface()->
232 SetContentRect(gfx::Rect(gfx::Point(), root_layer->bounds())); 232 SetContentRect(gfx::Rect(root_layer->bounds()));
233 233
234 root_layer->AddChild(root1); 234 root_layer->AddChild(root1);
235 root_layer->AddChild(root2); 235 root_layer->AddChild(root2);
236 root_layer->AddChild(root3); 236 root_layer->AddChild(root3);
237 root2->set_draws_content(false); 237 root2->set_draws_content(false);
238 root2->SetOpacity(0.5f); 238 root2->SetOpacity(0.5f);
239 root2->SetForceRenderSurface(true); // Force the layer to own a new surface. 239 root2->SetForceRenderSurface(true); // Force the layer to own a new surface.
240 root2->AddChild(root21); 240 root2->AddChild(root21);
241 root2->AddChild(root22); 241 root2->AddChild(root22);
242 root2->AddChild(root23); 242 root2->AddChild(root23);
(...skipping 29 matching lines...) Expand all
272 EXPECT_COUNT(root21, -1, -1, 9); 272 EXPECT_COUNT(root21, -1, -1, 9);
273 EXPECT_COUNT(root22, 7, 8, 6); 273 EXPECT_COUNT(root22, 7, 8, 6);
274 EXPECT_COUNT(root221, -1, -1, 5); 274 EXPECT_COUNT(root221, -1, -1, 5);
275 EXPECT_COUNT(root23, 3, 4, 2); 275 EXPECT_COUNT(root23, 3, 4, 2);
276 EXPECT_COUNT(root231, -1, -1, 1); 276 EXPECT_COUNT(root231, -1, -1, 1);
277 EXPECT_COUNT(root3, -1, -1, 0); 277 EXPECT_COUNT(root3, -1, -1, 0);
278 } 278 }
279 279
280 } // namespace 280 } // namespace
281 } // namespace cc 281 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/nine_patch_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698