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

Side by Side Diff: cc/layer_sorter_unittest.cc

Issue 11519018: [cc] Make LayerImpls point at LayerTreeImpl instead of LTHI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
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/layer_sorter.h" 5 #include "cc/layer_sorter.h"
6 6
7 #include "cc/layer_impl.h" 7 #include "cc/layer_impl.h"
8 #include "cc/math_util.h" 8 #include "cc/math_util.h"
9 #include "cc/single_thread_proxy.h" 9 #include "cc/single_thread_proxy.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 // Input list of layers: [1, 2, 3, 4, 5]. 196 // Input list of layers: [1, 2, 3, 4, 5].
197 // Expected output: [3, 4, 1, 2, 5]. 197 // Expected output: [3, 4, 1, 2, 5].
198 // - 1, 2, and 5 do not have a 3d z difference, and therefore their relat ive ordering should be retained. 198 // - 1, 2, and 5 do not have a 3d z difference, and therefore their relat ive ordering should be retained.
199 // - 3 and 4 do not have a 3d z difference, and therefore their relative ordering should be retained. 199 // - 3 and 4 do not have a 3d z difference, and therefore their relative ordering should be retained.
200 // - 3 and 4 should be re-sorted so they are in front of 1, 2, and 5. 200 // - 3 and 4 should be re-sorted so they are in front of 1, 2, and 5.
201 201
202 FakeImplProxy proxy; 202 FakeImplProxy proxy;
203 FakeLayerTreeHostImpl hostImpl(&proxy); 203 FakeLayerTreeHostImpl hostImpl(&proxy);
204 204
205 scoped_ptr<LayerImpl> layer1 = LayerImpl::create(&hostImpl, 1); 205 scoped_ptr<LayerImpl> layer1 = LayerImpl::create(hostImpl.activeTree(), 1);
206 scoped_ptr<LayerImpl> layer2 = LayerImpl::create(&hostImpl, 2); 206 scoped_ptr<LayerImpl> layer2 = LayerImpl::create(hostImpl.activeTree(), 2);
207 scoped_ptr<LayerImpl> layer3 = LayerImpl::create(&hostImpl, 3); 207 scoped_ptr<LayerImpl> layer3 = LayerImpl::create(hostImpl.activeTree(), 3);
208 scoped_ptr<LayerImpl> layer4 = LayerImpl::create(&hostImpl, 4); 208 scoped_ptr<LayerImpl> layer4 = LayerImpl::create(hostImpl.activeTree(), 4);
209 scoped_ptr<LayerImpl> layer5 = LayerImpl::create(&hostImpl, 5); 209 scoped_ptr<LayerImpl> layer5 = LayerImpl::create(hostImpl.activeTree(), 5);
210 210
211 gfx::Transform BehindMatrix; 211 gfx::Transform BehindMatrix;
212 BehindMatrix.Translate3d(0, 0, 2); 212 BehindMatrix.Translate3d(0, 0, 2);
213 gfx::Transform FrontMatrix; 213 gfx::Transform FrontMatrix;
214 FrontMatrix.Translate3d(0, 0, 1); 214 FrontMatrix.Translate3d(0, 0, 1);
215 215
216 layer1->setBounds(gfx::Size(10, 10)); 216 layer1->setBounds(gfx::Size(10, 10));
217 layer1->setContentBounds(gfx::Size(10, 10)); 217 layer1->setContentBounds(gfx::Size(10, 10));
218 layer1->drawProperties().target_space_transform = BehindMatrix; 218 layer1->drawProperties().target_space_transform = BehindMatrix;
219 layer1->setDrawsContent(true); 219 layer1->setDrawsContent(true);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 ASSERT_EQ(static_cast<size_t>(5), layerList.size()); 258 ASSERT_EQ(static_cast<size_t>(5), layerList.size());
259 EXPECT_EQ(3, layerList[0]->id()); 259 EXPECT_EQ(3, layerList[0]->id());
260 EXPECT_EQ(4, layerList[1]->id()); 260 EXPECT_EQ(4, layerList[1]->id());
261 EXPECT_EQ(1, layerList[2]->id()); 261 EXPECT_EQ(1, layerList[2]->id());
262 EXPECT_EQ(2, layerList[3]->id()); 262 EXPECT_EQ(2, layerList[3]->id());
263 EXPECT_EQ(5, layerList[4]->id()); 263 EXPECT_EQ(5, layerList[4]->id());
264 } 264 }
265 265
266 } // namespace 266 } // namespace
267 } // namespace cc 267 } // namespace cc
OLDNEW
« cc/layer.h ('K') | « cc/layer_impl_unittest.cc ('k') | cc/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698