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

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

Issue 2112973003: cc: Add verify transform tree calculations to LayerTreeSettings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "TODO" Created 4 years, 5 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/layers/picture_layer_impl_unittest.cc ('k') | cc/test/layer_tree_settings_for_testing.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 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/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 // PicturePile uses the source frame number as a unit for measuring invalidation 456 // PicturePile uses the source frame number as a unit for measuring invalidation
457 // frequency. When a pile moves between compositors, the frame number increases 457 // frequency. When a pile moves between compositors, the frame number increases
458 // non-monotonically. This executes that code path under this scenario allowing 458 // non-monotonically. This executes that code path under this scenario allowing
459 // for the code to verify correctness with DCHECKs. 459 // for the code to verify correctness with DCHECKs.
460 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) { 460 TEST(PictureLayerTest, NonMonotonicSourceFrameNumber) {
461 LayerTreeSettings settings; 461 LayerTreeSettings settings;
462 settings.single_thread_proxy_scheduler = false; 462 settings.single_thread_proxy_scheduler = false;
463 settings.use_zero_copy = true; 463 settings.use_zero_copy = true;
464 settings.verify_clip_tree_calculations = true; 464 settings.verify_clip_tree_calculations = true;
465 settings.verify_transform_tree_calculations = true;
465 466
466 FakeLayerTreeHostClient host_client1(FakeLayerTreeHostClient::DIRECT_3D); 467 FakeLayerTreeHostClient host_client1(FakeLayerTreeHostClient::DIRECT_3D);
467 FakeLayerTreeHostClient host_client2(FakeLayerTreeHostClient::DIRECT_3D); 468 FakeLayerTreeHostClient host_client2(FakeLayerTreeHostClient::DIRECT_3D);
468 TestSharedBitmapManager shared_bitmap_manager; 469 TestSharedBitmapManager shared_bitmap_manager;
469 TestTaskGraphRunner task_graph_runner; 470 TestTaskGraphRunner task_graph_runner;
470 471
471 ContentLayerClient* client = EmptyContentLayerClient::GetInstance(); 472 ContentLayerClient* client = EmptyContentLayerClient::GetInstance();
472 scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(client); 473 scoped_refptr<FakePictureLayer> layer = FakePictureLayer::Create(client);
473 474
474 LayerTreeHost::InitParams params; 475 LayerTreeHost::InitParams params;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 // Do a main frame, record the picture layers. The frame number has changed 521 // Do a main frame, record the picture layers. The frame number has changed
521 // non-monotonically. 522 // non-monotonically.
522 layer->SetNeedsDisplay(); 523 layer->SetNeedsDisplay();
523 host2->Composite(base::TimeTicks::Now()); 524 host2->Composite(base::TimeTicks::Now());
524 EXPECT_EQ(3, layer->update_count()); 525 EXPECT_EQ(3, layer->update_count());
525 EXPECT_EQ(1, host2->source_frame_number()); 526 EXPECT_EQ(1, host2->source_frame_number());
526 } 527 }
527 528
528 } // namespace 529 } // namespace
529 } // namespace cc 530 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/test/layer_tree_settings_for_testing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698