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

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

Issue 2269143003: cc : Add OnTransformAnimated to transform tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "cc/test/fake_content_layer_client.h" 7 #include "cc/test/fake_content_layer_client.h"
8 #include "cc/test/fake_picture_layer.h" 8 #include "cc/test/fake_picture_layer.h"
9 #include "cc/test/fake_picture_layer_impl.h" 9 #include "cc/test/fake_picture_layer_impl.h"
10 #include "cc/test/layer_tree_test.h" 10 #include "cc/test/layer_tree_test.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); 243 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y();
244 244
245 // There should be tiles at the top of the picture layer but not at the 245 // There should be tiles at the top of the picture layer but not at the
246 // bottom. 246 // bottom.
247 EXPECT_TRUE(tiling->TileAt(0, 0)); 247 EXPECT_TRUE(tiling->TileAt(0, 0));
248 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); 248 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y));
249 249
250 // Make the bottom of the layer visible. 250 // Make the bottom of the layer visible.
251 gfx::Transform transform; 251 gfx::Transform transform;
252 transform.Translate(0.f, -100000.f + 100.f); 252 transform.Translate(0.f, -100000.f + 100.f);
253 picture_impl->OnTransformAnimated(transform); 253 impl->active_tree()
254 ->property_trees()
255 ->transform_tree.OnTransformAnimated(
256 transform, picture_impl->transform_tree_index(),
257 impl->active_tree());
254 impl->SetNeedsRedraw(); 258 impl->SetNeedsRedraw();
255 break; 259 break;
256 } 260 }
257 case 2: { 261 case 2: {
258 PictureLayerTiling* tiling = picture_impl->HighResTiling(); 262 PictureLayerTiling* tiling = picture_impl->HighResTiling();
259 263
260 // There not be tiles at the top of the layer now. 264 // There not be tiles at the top of the layer now.
261 EXPECT_FALSE(tiling->TileAt(0, 0)); 265 EXPECT_FALSE(tiling->TileAt(0, 0));
262 266
263 // Make the top of the layer visible again. 267 // Make the top of the layer visible again.
264 picture_impl->OnTransformAnimated(gfx::Transform()); 268 impl->active_tree()
269 ->property_trees()
270 ->transform_tree.OnTransformAnimated(
271 gfx::Transform(), picture_impl->transform_tree_index(),
272 impl->active_tree());
265 impl->SetNeedsRedraw(); 273 impl->SetNeedsRedraw();
266 break; 274 break;
267 } 275 }
268 case 3: { 276 case 3: {
269 PictureLayerTiling* tiling = picture_impl->HighResTiling(); 277 PictureLayerTiling* tiling = picture_impl->HighResTiling();
270 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); 278 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y();
271 279
272 // There should be tiles at the top of the picture layer again. 280 // There should be tiles at the top of the picture layer again.
273 EXPECT_TRUE(tiling->TileAt(0, 0)); 281 EXPECT_TRUE(tiling->TileAt(0, 0));
274 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); 282 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y));
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 int last_frame_drawn_; 571 int last_frame_drawn_;
564 bool ready_to_draw_; 572 bool ready_to_draw_;
565 }; 573 };
566 574
567 // Multi-thread only because in single thread you can't pinch zoom on the 575 // Multi-thread only because in single thread you can't pinch zoom on the
568 // compositor thread. 576 // compositor thread.
569 MULTI_THREAD_TEST_F(LayerTreeHostPictureTestRSLLMembershipWithScale); 577 MULTI_THREAD_TEST_F(LayerTreeHostPictureTestRSLLMembershipWithScale);
570 578
571 } // namespace 579 } // namespace
572 } // namespace cc 580 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698