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

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

Issue 2231233002: cc: Remove the lie of "DirectRenderer" in LayerTreeTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no-ltt-delegating: ccpt Created 4 years, 4 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 bool use_gl_renderer_; 147 bool use_gl_renderer_;
148 bool out_of_order_callbacks_ = false; 148 bool out_of_order_callbacks_ = false;
149 std::map<size_t, gfx::Size> callbacks_; 149 std::map<size_t, gfx::Size> callbacks_;
150 FakeContentLayerClient client_; 150 FakeContentLayerClient client_;
151 scoped_refptr<FakePictureLayer> root; 151 scoped_refptr<FakePictureLayer> root;
152 scoped_refptr<FakePictureLayer> child; 152 scoped_refptr<FakePictureLayer> child;
153 scoped_refptr<FakePictureLayer> grand_child; 153 scoped_refptr<FakePictureLayer> grand_child;
154 }; 154 };
155 155
156 // Readback can't be done with a delegating renderer.
157 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests, 156 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
158 GLRenderer_RunSingleThread) { 157 GLRenderer_RunSingleThread) {
159 use_gl_renderer_ = true; 158 use_gl_renderer_ = true;
160 RunTest(CompositorMode::SINGLE_THREADED, false); 159 RunTest(CompositorMode::SINGLE_THREADED);
161 } 160 }
162 161
163 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests, 162 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
164 GLRenderer_RunMultiThread) { 163 GLRenderer_RunMultiThread) {
165 use_gl_renderer_ = true; 164 use_gl_renderer_ = true;
166 RunTest(CompositorMode::THREADED, false); 165 RunTest(CompositorMode::THREADED);
167 } 166 }
168 167
169 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests, 168 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
170 GLRenderer_RunSingleThread_OutOfOrderCallbacks) { 169 GLRenderer_RunSingleThread_OutOfOrderCallbacks) {
171 use_gl_renderer_ = true; 170 use_gl_renderer_ = true;
172 out_of_order_callbacks_ = true; 171 out_of_order_callbacks_ = true;
173 RunTest(CompositorMode::SINGLE_THREADED, false); 172 RunTest(CompositorMode::SINGLE_THREADED);
174 } 173 }
175 174
176 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests, 175 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
177 GLRenderer_RunMultiThread_OutOfOrderCallbacks) { 176 GLRenderer_RunMultiThread_OutOfOrderCallbacks) {
178 use_gl_renderer_ = true; 177 use_gl_renderer_ = true;
179 out_of_order_callbacks_ = true; 178 out_of_order_callbacks_ = true;
180 RunTest(CompositorMode::THREADED, false); 179 RunTest(CompositorMode::THREADED);
181 } 180 }
182 181
183 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests, 182 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
184 SoftwareRenderer_RunSingleThread) { 183 SoftwareRenderer_RunSingleThread) {
185 use_gl_renderer_ = false; 184 use_gl_renderer_ = false;
186 RunTest(CompositorMode::SINGLE_THREADED, false); 185 RunTest(CompositorMode::SINGLE_THREADED);
187 } 186 }
188 187
189 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests, 188 TEST_F(LayerTreeHostCopyRequestTestMultipleRequests,
190 SoftwareRenderer_RunMultiThread) { 189 SoftwareRenderer_RunMultiThread) {
191 use_gl_renderer_ = false; 190 use_gl_renderer_ = false;
192 RunTest(CompositorMode::THREADED, false); 191 RunTest(CompositorMode::THREADED);
193 } 192 }
194 193
195 // TODO(crbug.com/564832): Remove this test when the workaround it tests is no 194 // TODO(crbug.com/564832): Remove this test when the workaround it tests is no
196 // longer needed. 195 // longer needed.
197 class LayerTreeHostCopyRequestCompletionCausesCommit 196 class LayerTreeHostCopyRequestCompletionCausesCommit
198 : public LayerTreeHostCopyRequestTest { 197 : public LayerTreeHostCopyRequestTest {
199 protected: 198 protected:
200 void SetupTree() override { 199 void SetupTree() override {
201 root_ = FakePictureLayer::Create(&client_); 200 root_ = FakePictureLayer::Create(&client_);
202 root_->SetBounds(gfx::Size(20, 20)); 201 root_->SetBounds(gfx::Size(20, 20));
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 EXPECT_FALSE(result->IsEmpty()); 235 EXPECT_FALSE(result->IsEmpty());
237 } 236 }
238 237
239 void AfterTest() override {} 238 void AfterTest() override {}
240 239
241 FakeContentLayerClient client_; 240 FakeContentLayerClient client_;
242 scoped_refptr<FakePictureLayer> root_; 241 scoped_refptr<FakePictureLayer> root_;
243 scoped_refptr<FakePictureLayer> layer_; 242 scoped_refptr<FakePictureLayer> layer_;
244 }; 243 };
245 244
246 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 245 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestCompletionCausesCommit);
247 LayerTreeHostCopyRequestCompletionCausesCommit);
248 246
249 class LayerTreeHostCopyRequestTestLayerDestroyed 247 class LayerTreeHostCopyRequestTestLayerDestroyed
250 : public LayerTreeHostCopyRequestTest { 248 : public LayerTreeHostCopyRequestTest {
251 protected: 249 protected:
252 void SetupTree() override { 250 void SetupTree() override {
253 root_ = FakePictureLayer::Create(&client_); 251 root_ = FakePictureLayer::Create(&client_);
254 root_->SetBounds(gfx::Size(20, 20)); 252 root_->SetBounds(gfx::Size(20, 20));
255 253
256 main_destroyed_ = FakePictureLayer::Create(&client_); 254 main_destroyed_ = FakePictureLayer::Create(&client_);
257 main_destroyed_->SetBounds(gfx::Size(15, 15)); 255 main_destroyed_->SetBounds(gfx::Size(15, 15));
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 void AfterTest() override {} 427 void AfterTest() override {}
430 428
431 int callback_count_; 429 int callback_count_;
432 FakeContentLayerClient client_; 430 FakeContentLayerClient client_;
433 scoped_refptr<FakePictureLayer> root_; 431 scoped_refptr<FakePictureLayer> root_;
434 scoped_refptr<FakePictureLayer> grand_parent_layer_; 432 scoped_refptr<FakePictureLayer> grand_parent_layer_;
435 scoped_refptr<FakePictureLayer> parent_layer_; 433 scoped_refptr<FakePictureLayer> parent_layer_;
436 scoped_refptr<FakePictureLayer> copy_layer_; 434 scoped_refptr<FakePictureLayer> copy_layer_;
437 }; 435 };
438 436
439 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 437 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestInHiddenSubtree);
440 LayerTreeHostCopyRequestTestInHiddenSubtree);
441 438
442 class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest 439 class LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest
443 : public LayerTreeHostCopyRequestTest { 440 : public LayerTreeHostCopyRequestTest {
444 protected: 441 protected:
445 void SetupTree() override { 442 void SetupTree() override {
446 root_ = FakePictureLayer::Create(&client_); 443 root_ = FakePictureLayer::Create(&client_);
447 root_->SetBounds(gfx::Size(20, 20)); 444 root_->SetBounds(gfx::Size(20, 20));
448 445
449 grand_parent_layer_ = FakePictureLayer::Create(&client_); 446 grand_parent_layer_ = FakePictureLayer::Create(&client_);
450 grand_parent_layer_->SetBounds(gfx::Size(15, 15)); 447 grand_parent_layer_->SetBounds(gfx::Size(15, 15));
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 RenderPassId copy_layer_render_pass_id; 535 RenderPassId copy_layer_render_pass_id;
539 Display* display_ = nullptr; 536 Display* display_ = nullptr;
540 bool did_swap_ = false; 537 bool did_swap_ = false;
541 FakeContentLayerClient client_; 538 FakeContentLayerClient client_;
542 scoped_refptr<FakePictureLayer> root_; 539 scoped_refptr<FakePictureLayer> root_;
543 scoped_refptr<FakePictureLayer> grand_parent_layer_; 540 scoped_refptr<FakePictureLayer> grand_parent_layer_;
544 scoped_refptr<FakePictureLayer> parent_layer_; 541 scoped_refptr<FakePictureLayer> parent_layer_;
545 scoped_refptr<FakePictureLayer> copy_layer_; 542 scoped_refptr<FakePictureLayer> copy_layer_;
546 }; 543 };
547 544
548 // No output to copy for delegated renderers. 545 SINGLE_AND_MULTI_THREAD_TEST_F(
549 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(
550 LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest); 546 LayerTreeHostTestHiddenSurfaceNotAllocatedForSubtreeCopyRequest);
551 547
552 class LayerTreeHostCopyRequestTestClippedOut 548 class LayerTreeHostCopyRequestTestClippedOut
553 : public LayerTreeHostCopyRequestTest { 549 : public LayerTreeHostCopyRequestTest {
554 protected: 550 protected:
555 void SetupTree() override { 551 void SetupTree() override {
556 root_ = FakePictureLayer::Create(&client_); 552 root_ = FakePictureLayer::Create(&client_);
557 root_->SetBounds(gfx::Size(20, 20)); 553 root_->SetBounds(gfx::Size(20, 20));
558 554
559 parent_layer_ = FakePictureLayer::Create(&client_); 555 parent_layer_ = FakePictureLayer::Create(&client_);
(...skipping 28 matching lines...) Expand all
588 } 584 }
589 585
590 void AfterTest() override {} 586 void AfterTest() override {}
591 587
592 FakeContentLayerClient client_; 588 FakeContentLayerClient client_;
593 scoped_refptr<FakePictureLayer> root_; 589 scoped_refptr<FakePictureLayer> root_;
594 scoped_refptr<FakePictureLayer> parent_layer_; 590 scoped_refptr<FakePictureLayer> parent_layer_;
595 scoped_refptr<FakePictureLayer> copy_layer_; 591 scoped_refptr<FakePictureLayer> copy_layer_;
596 }; 592 };
597 593
598 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 594 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestClippedOut);
599 LayerTreeHostCopyRequestTestClippedOut);
600 595
601 class LayerTreeHostCopyRequestTestScaledLayer 596 class LayerTreeHostCopyRequestTestScaledLayer
602 : public LayerTreeHostCopyRequestTest { 597 : public LayerTreeHostCopyRequestTest {
603 protected: 598 protected:
604 void SetupTree() override { 599 void SetupTree() override {
605 root_ = Layer::Create(); 600 root_ = Layer::Create();
606 root_->SetBounds(gfx::Size(20, 20)); 601 root_->SetBounds(gfx::Size(20, 20));
607 602
608 gfx::Transform scale; 603 gfx::Transform scale;
609 scale.Scale(2, 2); 604 scale.Scale(2, 2);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 } 636 }
642 637
643 void AfterTest() override {} 638 void AfterTest() override {}
644 639
645 FakeContentLayerClient client_; 640 FakeContentLayerClient client_;
646 scoped_refptr<Layer> root_; 641 scoped_refptr<Layer> root_;
647 scoped_refptr<Layer> copy_layer_; 642 scoped_refptr<Layer> copy_layer_;
648 scoped_refptr<FakePictureLayer> child_layer_; 643 scoped_refptr<FakePictureLayer> child_layer_;
649 }; 644 };
650 645
651 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 646 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestScaledLayer);
652 LayerTreeHostCopyRequestTestScaledLayer);
653 647
654 class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw 648 class LayerTreeHostTestAsyncTwoReadbacksWithoutDraw
655 : public LayerTreeHostCopyRequestTest { 649 : public LayerTreeHostCopyRequestTest {
656 protected: 650 protected:
657 void SetupTree() override { 651 void SetupTree() override {
658 root_ = FakePictureLayer::Create(&client_); 652 root_ = FakePictureLayer::Create(&client_);
659 root_->SetBounds(gfx::Size(20, 20)); 653 root_->SetBounds(gfx::Size(20, 20));
660 654
661 copy_layer_ = FakePictureLayer::Create(&client_); 655 copy_layer_ = FakePictureLayer::Create(&client_);
662 copy_layer_->SetBounds(gfx::Size(10, 10)); 656 copy_layer_->SetBounds(gfx::Size(10, 10));
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 719
726 void AfterTest() override { EXPECT_TRUE(saw_copy_request_); } 720 void AfterTest() override { EXPECT_TRUE(saw_copy_request_); }
727 721
728 bool saw_copy_request_; 722 bool saw_copy_request_;
729 int callback_count_; 723 int callback_count_;
730 FakeContentLayerClient client_; 724 FakeContentLayerClient client_;
731 scoped_refptr<FakePictureLayer> root_; 725 scoped_refptr<FakePictureLayer> root_;
732 scoped_refptr<FakePictureLayer> copy_layer_; 726 scoped_refptr<FakePictureLayer> copy_layer_;
733 }; 727 };
734 728
735 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 729 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestAsyncTwoReadbacksWithoutDraw);
736 LayerTreeHostTestAsyncTwoReadbacksWithoutDraw);
737 730
738 class LayerTreeHostCopyRequestTestDeleteTexture 731 class LayerTreeHostCopyRequestTestDeleteTexture
739 : public LayerTreeHostCopyRequestTest { 732 : public LayerTreeHostCopyRequestTest {
740 protected: 733 protected:
741 std::unique_ptr<OutputSurface> CreateDisplayOutputSurface( 734 std::unique_ptr<OutputSurface> CreateDisplayOutputSurface(
742 scoped_refptr<ContextProvider> compositor_context_provider) override { 735 scoped_refptr<ContextProvider> compositor_context_provider) override {
743 display_context_provider_ = TestContextProvider::Create(); 736 display_context_provider_ = TestContextProvider::Create();
744 return FakeOutputSurface::Create3d(display_context_provider_); 737 return FakeOutputSurface::Create3d(display_context_provider_);
745 } 738 }
746 739
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 scoped_refptr<TestContextProvider> display_context_provider_; 830 scoped_refptr<TestContextProvider> display_context_provider_;
838 int num_swaps_ = 0; 831 int num_swaps_ = 0;
839 size_t num_textures_without_readback_ = 0; 832 size_t num_textures_without_readback_ = 0;
840 size_t num_textures_after_readback_ = 0; 833 size_t num_textures_after_readback_ = 0;
841 FakeContentLayerClient client_; 834 FakeContentLayerClient client_;
842 scoped_refptr<FakePictureLayer> root_; 835 scoped_refptr<FakePictureLayer> root_;
843 scoped_refptr<FakePictureLayer> copy_layer_; 836 scoped_refptr<FakePictureLayer> copy_layer_;
844 std::unique_ptr<CopyOutputResult> result_; 837 std::unique_ptr<CopyOutputResult> result_;
845 }; 838 };
846 839
847 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 840 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestDeleteTexture);
848 LayerTreeHostCopyRequestTestDeleteTexture);
849 841
850 class LayerTreeHostCopyRequestTestCountTextures 842 class LayerTreeHostCopyRequestTestCountTextures
851 : public LayerTreeHostCopyRequestTest { 843 : public LayerTreeHostCopyRequestTest {
852 protected: 844 protected:
853 void InitializeSettings(LayerTreeSettings* settings) override { 845 void InitializeSettings(LayerTreeSettings* settings) override {
854 // Always allocate only a single texture at a time through ResourceProvider. 846 // Always allocate only a single texture at a time through ResourceProvider.
855 settings->renderer_settings.texture_id_allocation_chunk_size = 1; 847 settings->renderer_settings.texture_id_allocation_chunk_size = 1;
856 } 848 }
857 849
858 std::unique_ptr<OutputSurface> CreateDisplayOutputSurface( 850 std::unique_ptr<OutputSurface> CreateDisplayOutputSurface(
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 961
970 // No sync point was needed. 962 // No sync point was needed.
971 EXPECT_FALSE(waited_sync_token_after_readback_.HasData()); 963 EXPECT_FALSE(waited_sync_token_after_readback_.HasData());
972 // Except the copy to have made another texture. 964 // Except the copy to have made another texture.
973 EXPECT_EQ(num_textures_without_readback_ + 1, num_textures_with_readback_); 965 EXPECT_EQ(num_textures_without_readback_ + 1, num_textures_with_readback_);
974 } 966 }
975 967
976 std::unique_ptr<SingleReleaseCallback> release_; 968 std::unique_ptr<SingleReleaseCallback> release_;
977 }; 969 };
978 970
979 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 971 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestCreatesTexture);
980 LayerTreeHostCopyRequestTestCreatesTexture);
981 972
982 class LayerTreeHostCopyRequestTestProvideTexture 973 class LayerTreeHostCopyRequestTestProvideTexture
983 : public LayerTreeHostCopyRequestTestCountTextures { 974 : public LayerTreeHostCopyRequestTestCountTextures {
984 protected: 975 protected:
985 void BeginTest() override { 976 void BeginTest() override {
986 external_context_provider_ = TestContextProvider::Create(); 977 external_context_provider_ = TestContextProvider::Create();
987 EXPECT_TRUE(external_context_provider_->BindToCurrentThread()); 978 EXPECT_TRUE(external_context_provider_->BindToCurrentThread());
988 LayerTreeHostCopyRequestTestCountTextures::BeginTest(); 979 LayerTreeHostCopyRequestTestCountTextures::BeginTest();
989 } 980 }
990 981
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 // TextureMailbox. 1017 // TextureMailbox.
1027 EXPECT_EQ(sync_token_, waited_sync_token_after_readback_); 1018 EXPECT_EQ(sync_token_, waited_sync_token_after_readback_);
1028 // Except the copy to have *not* made another texture. 1019 // Except the copy to have *not* made another texture.
1029 EXPECT_EQ(num_textures_without_readback_, num_textures_with_readback_); 1020 EXPECT_EQ(num_textures_without_readback_, num_textures_with_readback_);
1030 } 1021 }
1031 1022
1032 scoped_refptr<TestContextProvider> external_context_provider_; 1023 scoped_refptr<TestContextProvider> external_context_provider_;
1033 gpu::SyncToken sync_token_; 1024 gpu::SyncToken sync_token_;
1034 }; 1025 };
1035 1026
1036 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 1027 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestProvideTexture);
1037 LayerTreeHostCopyRequestTestProvideTexture);
1038 1028
1039 class LayerTreeHostCopyRequestTestDestroyBeforeCopy 1029 class LayerTreeHostCopyRequestTestDestroyBeforeCopy
1040 : public LayerTreeHostCopyRequestTest { 1030 : public LayerTreeHostCopyRequestTest {
1041 protected: 1031 protected:
1042 void SetupTree() override { 1032 void SetupTree() override {
1043 root_ = FakePictureLayer::Create(&client_); 1033 root_ = FakePictureLayer::Create(&client_);
1044 root_->SetBounds(gfx::Size(20, 20)); 1034 root_->SetBounds(gfx::Size(20, 20));
1045 1035
1046 copy_layer_ = FakePictureLayer::Create(&client_); 1036 copy_layer_ = FakePictureLayer::Create(&client_);
1047 copy_layer_->SetBounds(gfx::Size(10, 10)); 1037 copy_layer_->SetBounds(gfx::Size(10, 10));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 } 1094 }
1105 1095
1106 void AfterTest() override {} 1096 void AfterTest() override {}
1107 1097
1108 int callback_count_; 1098 int callback_count_;
1109 FakeContentLayerClient client_; 1099 FakeContentLayerClient client_;
1110 scoped_refptr<FakePictureLayer> root_; 1100 scoped_refptr<FakePictureLayer> root_;
1111 scoped_refptr<FakePictureLayer> copy_layer_; 1101 scoped_refptr<FakePictureLayer> copy_layer_;
1112 }; 1102 };
1113 1103
1114 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 1104 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestDestroyBeforeCopy);
1115 LayerTreeHostCopyRequestTestDestroyBeforeCopy);
1116 1105
1117 class LayerTreeHostCopyRequestTestShutdownBeforeCopy 1106 class LayerTreeHostCopyRequestTestShutdownBeforeCopy
1118 : public LayerTreeHostCopyRequestTest { 1107 : public LayerTreeHostCopyRequestTest {
1119 protected: 1108 protected:
1120 void SetupTree() override { 1109 void SetupTree() override {
1121 root_ = FakePictureLayer::Create(&client_); 1110 root_ = FakePictureLayer::Create(&client_);
1122 root_->SetBounds(gfx::Size(20, 20)); 1111 root_->SetBounds(gfx::Size(20, 20));
1123 1112
1124 copy_layer_ = FakePictureLayer::Create(&client_); 1113 copy_layer_ = FakePictureLayer::Create(&client_);
1125 copy_layer_->SetBounds(gfx::Size(10, 10)); 1114 copy_layer_->SetBounds(gfx::Size(10, 10));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 } 1165 }
1177 1166
1178 void AfterTest() override { EXPECT_EQ(1, callback_count_); } 1167 void AfterTest() override { EXPECT_EQ(1, callback_count_); }
1179 1168
1180 int callback_count_; 1169 int callback_count_;
1181 FakeContentLayerClient client_; 1170 FakeContentLayerClient client_;
1182 scoped_refptr<FakePictureLayer> root_; 1171 scoped_refptr<FakePictureLayer> root_;
1183 scoped_refptr<FakePictureLayer> copy_layer_; 1172 scoped_refptr<FakePictureLayer> copy_layer_;
1184 }; 1173 };
1185 1174
1186 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 1175 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostCopyRequestTestShutdownBeforeCopy);
1187 LayerTreeHostCopyRequestTestShutdownBeforeCopy);
1188 1176
1189 class LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest 1177 class LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest
1190 : public LayerTreeHostCopyRequestTest { 1178 : public LayerTreeHostCopyRequestTest {
1191 protected: 1179 protected:
1192 void SetupTree() override { 1180 void SetupTree() override {
1193 scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_); 1181 scoped_refptr<FakePictureLayer> root = FakePictureLayer::Create(&client_);
1194 root->SetBounds(gfx::Size(20, 20)); 1182 root->SetBounds(gfx::Size(20, 20));
1195 1183
1196 child_ = FakePictureLayer::Create(&client_); 1184 child_ = FakePictureLayer::Create(&client_);
1197 child_->SetBounds(gfx::Size(10, 10)); 1185 child_->SetBounds(gfx::Size(10, 10));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 1280
1293 void AfterTest() override {} 1281 void AfterTest() override {}
1294 1282
1295 scoped_refptr<FakePictureLayer> child_; 1283 scoped_refptr<FakePictureLayer> child_;
1296 FakeContentLayerClient client_; 1284 FakeContentLayerClient client_;
1297 int num_draws_; 1285 int num_draws_;
1298 bool copy_happened_; 1286 bool copy_happened_;
1299 bool draw_happened_; 1287 bool draw_happened_;
1300 }; 1288 };
1301 1289
1302 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( 1290 SINGLE_AND_MULTI_THREAD_TEST_F(
1303 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest); 1291 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest);
1304 1292
1305 } // namespace 1293 } // namespace
1306 } // namespace cc 1294 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_context.cc ('k') | cc/trees/layer_tree_host_unittest_scroll.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698