| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/output/compositor_frame.h" | 5 #include "cc/output/compositor_frame.h" |
| 6 #include "cc/output/delegated_frame_data.h" | 6 #include "cc/output/delegated_frame_data.h" |
| 7 #include "cc/quads/render_pass.h" | 7 #include "cc/quads/render_pass.h" |
| 8 #include "cc/quads/render_pass_draw_quad.h" | 8 #include "cc/quads/render_pass_draw_quad.h" |
| 9 #include "cc/quads/solid_color_draw_quad.h" | 9 #include "cc/quads/solid_color_draw_quad.h" |
| 10 #include "cc/quads/surface_draw_quad.h" | 10 #include "cc/quads/surface_draw_quad.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 aggregator_.previous_contained_surfaces().find(surface_ids[i]) != | 150 aggregator_.previous_contained_surfaces().find(surface_ids[i]) != |
| 151 aggregator_.previous_contained_surfaces().end()); | 151 aggregator_.previous_contained_surfaces().end()); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 void SubmitPassListAsFrame(SurfaceId surface_id, RenderPassList* pass_list) { | 155 void SubmitPassListAsFrame(SurfaceId surface_id, RenderPassList* pass_list) { |
| 156 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 156 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 157 pass_list->swap(frame_data->render_pass_list); | 157 pass_list->swap(frame_data->render_pass_list); |
| 158 | 158 |
| 159 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 159 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 160 frame->delegated_frame_data = frame_data.Pass(); | 160 frame->delegated_frame_data = std::move(frame_data); |
| 161 | 161 |
| 162 factory_.SubmitCompositorFrame(surface_id, frame.Pass(), | 162 factory_.SubmitCompositorFrame(surface_id, std::move(frame), |
| 163 SurfaceFactory::DrawCallback()); | 163 SurfaceFactory::DrawCallback()); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void SubmitCompositorFrame(test::Pass* passes, | 166 void SubmitCompositorFrame(test::Pass* passes, |
| 167 size_t pass_count, | 167 size_t pass_count, |
| 168 SurfaceId surface_id) { | 168 SurfaceId surface_id) { |
| 169 RenderPassList pass_list; | 169 RenderPassList pass_list; |
| 170 AddPasses(&pass_list, gfx::Rect(SurfaceSize()), passes, pass_count); | 170 AddPasses(&pass_list, gfx::Rect(SurfaceSize()), passes, pass_count); |
| 171 SubmitPassListAsFrame(surface_id, &pass_list); | 171 SubmitPassListAsFrame(surface_id, &pass_list); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void QueuePassAsFrame(scoped_ptr<RenderPass> pass, SurfaceId surface_id) { | 174 void QueuePassAsFrame(scoped_ptr<RenderPass> pass, SurfaceId surface_id) { |
| 175 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); | 175 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); |
| 176 delegated_frame_data->render_pass_list.push_back(pass.Pass()); | 176 delegated_frame_data->render_pass_list.push_back(std::move(pass)); |
| 177 | 177 |
| 178 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 178 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 179 child_frame->delegated_frame_data = delegated_frame_data.Pass(); | 179 child_frame->delegated_frame_data = std::move(delegated_frame_data); |
| 180 | 180 |
| 181 factory_.SubmitCompositorFrame(surface_id, child_frame.Pass(), | 181 factory_.SubmitCompositorFrame(surface_id, std::move(child_frame), |
| 182 SurfaceFactory::DrawCallback()); | 182 SurfaceFactory::DrawCallback()); |
| 183 } | 183 } |
| 184 | 184 |
| 185 protected: | 185 protected: |
| 186 SurfaceId root_surface_id_; | 186 SurfaceId root_surface_id_; |
| 187 Surface* root_surface_; | 187 Surface* root_surface_; |
| 188 SurfaceIdAllocator allocator_; | 188 SurfaceIdAllocator allocator_; |
| 189 SurfaceIdAllocator child_allocator_; | 189 SurfaceIdAllocator child_allocator_; |
| 190 }; | 190 }; |
| 191 | 191 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 322 |
| 323 test::Quad embedded_quads[] = {test::Quad::SolidColorQuad(SK_ColorGREEN)}; | 323 test::Quad embedded_quads[] = {test::Quad::SolidColorQuad(SK_ColorGREEN)}; |
| 324 test::Pass embedded_passes[] = { | 324 test::Pass embedded_passes[] = { |
| 325 test::Pass(embedded_quads, arraysize(embedded_quads))}; | 325 test::Pass(embedded_quads, arraysize(embedded_quads))}; |
| 326 | 326 |
| 327 SubmitCompositorFrame(embedded_passes, arraysize(embedded_passes), | 327 SubmitCompositorFrame(embedded_passes, arraysize(embedded_passes), |
| 328 embedded_surface_id); | 328 embedded_surface_id); |
| 329 scoped_ptr<CopyOutputRequest> copy_request( | 329 scoped_ptr<CopyOutputRequest> copy_request( |
| 330 CopyOutputRequest::CreateEmptyRequest()); | 330 CopyOutputRequest::CreateEmptyRequest()); |
| 331 CopyOutputRequest* copy_request_ptr = copy_request.get(); | 331 CopyOutputRequest* copy_request_ptr = copy_request.get(); |
| 332 factory_.RequestCopyOfSurface(embedded_surface_id, copy_request.Pass()); | 332 factory_.RequestCopyOfSurface(embedded_surface_id, std::move(copy_request)); |
| 333 | 333 |
| 334 test::Quad root_quads[] = {test::Quad::SolidColorQuad(SK_ColorWHITE), | 334 test::Quad root_quads[] = {test::Quad::SolidColorQuad(SK_ColorWHITE), |
| 335 test::Quad::SurfaceQuad(embedded_surface_id, 1.f), | 335 test::Quad::SurfaceQuad(embedded_surface_id, 1.f), |
| 336 test::Quad::SolidColorQuad(SK_ColorBLACK)}; | 336 test::Quad::SolidColorQuad(SK_ColorBLACK)}; |
| 337 test::Pass root_passes[] = {test::Pass(root_quads, arraysize(root_quads))}; | 337 test::Pass root_passes[] = {test::Pass(root_quads, arraysize(root_quads))}; |
| 338 | 338 |
| 339 SubmitCompositorFrame(root_passes, arraysize(root_passes), root_surface_id_); | 339 SubmitCompositorFrame(root_passes, arraysize(root_passes), root_surface_id_); |
| 340 | 340 |
| 341 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); | 341 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); |
| 342 EXPECT_FALSE(surface_aggregator_client_.HasSurface(embedded_surface)); | 342 EXPECT_FALSE(surface_aggregator_client_.HasSurface(embedded_surface)); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 test::Quad root_quads2[] = {test::Quad::SolidColorQuad(SK_ColorRED)}; | 405 test::Quad root_quads2[] = {test::Quad::SolidColorQuad(SK_ColorRED)}; |
| 406 test::Pass root_passes[] = { | 406 test::Pass root_passes[] = { |
| 407 test::Pass(root_quads, arraysize(root_quads), RenderPassId(1, 1)), | 407 test::Pass(root_quads, arraysize(root_quads), RenderPassId(1, 1)), |
| 408 test::Pass(root_quads2, arraysize(root_quads2), RenderPassId(1, 2))}; | 408 test::Pass(root_quads2, arraysize(root_quads2), RenderPassId(1, 2))}; |
| 409 { | 409 { |
| 410 RenderPassList pass_list; | 410 RenderPassList pass_list; |
| 411 AddPasses(&pass_list, | 411 AddPasses(&pass_list, |
| 412 gfx::Rect(SurfaceSize()), | 412 gfx::Rect(SurfaceSize()), |
| 413 root_passes, | 413 root_passes, |
| 414 arraysize(root_passes)); | 414 arraysize(root_passes)); |
| 415 pass_list[0]->copy_requests.push_back(copy_request.Pass()); | 415 pass_list[0]->copy_requests.push_back(std::move(copy_request)); |
| 416 pass_list[1]->copy_requests.push_back(copy_request2.Pass()); | 416 pass_list[1]->copy_requests.push_back(std::move(copy_request2)); |
| 417 | 417 |
| 418 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 418 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 419 pass_list.swap(frame_data->render_pass_list); | 419 pass_list.swap(frame_data->render_pass_list); |
| 420 | 420 |
| 421 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 421 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 422 frame->delegated_frame_data = frame_data.Pass(); | 422 frame->delegated_frame_data = std::move(frame_data); |
| 423 | 423 |
| 424 factory_.SubmitCompositorFrame(root_surface_id_, frame.Pass(), | 424 factory_.SubmitCompositorFrame(root_surface_id_, std::move(frame), |
| 425 SurfaceFactory::DrawCallback()); | 425 SurfaceFactory::DrawCallback()); |
| 426 } | 426 } |
| 427 | 427 |
| 428 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); | 428 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); |
| 429 EXPECT_FALSE(surface_aggregator_client_.HasSurface(embedded_surface)); | 429 EXPECT_FALSE(surface_aggregator_client_.HasSurface(embedded_surface)); |
| 430 | 430 |
| 431 scoped_ptr<CompositorFrame> aggregated_frame = | 431 scoped_ptr<CompositorFrame> aggregated_frame = |
| 432 aggregator_.Aggregate(root_surface_id_); | 432 aggregator_.Aggregate(root_surface_id_); |
| 433 | 433 |
| 434 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 434 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 Surface* grandchild_surface = manager_.GetSurfaceForId(grandchild_surface_id); | 880 Surface* grandchild_surface = manager_.GetSurfaceForId(grandchild_surface_id); |
| 881 EXPECT_FALSE(surface_aggregator_client_.HasSurface(grandchild_surface)); | 881 EXPECT_FALSE(surface_aggregator_client_.HasSurface(grandchild_surface)); |
| 882 scoped_ptr<RenderPass> grandchild_pass = RenderPass::Create(); | 882 scoped_ptr<RenderPass> grandchild_pass = RenderPass::Create(); |
| 883 gfx::Rect output_rect(SurfaceSize()); | 883 gfx::Rect output_rect(SurfaceSize()); |
| 884 gfx::Rect damage_rect(SurfaceSize()); | 884 gfx::Rect damage_rect(SurfaceSize()); |
| 885 gfx::Transform transform_to_root_target; | 885 gfx::Transform transform_to_root_target; |
| 886 grandchild_pass->SetNew( | 886 grandchild_pass->SetNew( |
| 887 pass_id, output_rect, damage_rect, transform_to_root_target); | 887 pass_id, output_rect, damage_rect, transform_to_root_target); |
| 888 AddSolidColorQuadWithBlendMode( | 888 AddSolidColorQuadWithBlendMode( |
| 889 SurfaceSize(), grandchild_pass.get(), blend_modes[2]); | 889 SurfaceSize(), grandchild_pass.get(), blend_modes[2]); |
| 890 QueuePassAsFrame(grandchild_pass.Pass(), grandchild_surface_id); | 890 QueuePassAsFrame(std::move(grandchild_pass), grandchild_surface_id); |
| 891 | 891 |
| 892 SurfaceId child_one_surface_id = allocator_.GenerateId(); | 892 SurfaceId child_one_surface_id = allocator_.GenerateId(); |
| 893 factory_.Create(child_one_surface_id); | 893 factory_.Create(child_one_surface_id); |
| 894 Surface* child_one_surface = manager_.GetSurfaceForId(child_one_surface_id); | 894 Surface* child_one_surface = manager_.GetSurfaceForId(child_one_surface_id); |
| 895 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_one_surface)); | 895 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_one_surface)); |
| 896 | 896 |
| 897 scoped_ptr<RenderPass> child_one_pass = RenderPass::Create(); | 897 scoped_ptr<RenderPass> child_one_pass = RenderPass::Create(); |
| 898 child_one_pass->SetNew( | 898 child_one_pass->SetNew( |
| 899 pass_id, output_rect, damage_rect, transform_to_root_target); | 899 pass_id, output_rect, damage_rect, transform_to_root_target); |
| 900 AddSolidColorQuadWithBlendMode( | 900 AddSolidColorQuadWithBlendMode( |
| 901 SurfaceSize(), child_one_pass.get(), blend_modes[1]); | 901 SurfaceSize(), child_one_pass.get(), blend_modes[1]); |
| 902 SurfaceDrawQuad* grandchild_surface_quad = | 902 SurfaceDrawQuad* grandchild_surface_quad = |
| 903 child_one_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 903 child_one_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
| 904 grandchild_surface_quad->SetNew(child_one_pass->shared_quad_state_list.back(), | 904 grandchild_surface_quad->SetNew(child_one_pass->shared_quad_state_list.back(), |
| 905 gfx::Rect(SurfaceSize()), | 905 gfx::Rect(SurfaceSize()), |
| 906 gfx::Rect(SurfaceSize()), | 906 gfx::Rect(SurfaceSize()), |
| 907 grandchild_surface_id); | 907 grandchild_surface_id); |
| 908 AddSolidColorQuadWithBlendMode( | 908 AddSolidColorQuadWithBlendMode( |
| 909 SurfaceSize(), child_one_pass.get(), blend_modes[3]); | 909 SurfaceSize(), child_one_pass.get(), blend_modes[3]); |
| 910 QueuePassAsFrame(child_one_pass.Pass(), child_one_surface_id); | 910 QueuePassAsFrame(std::move(child_one_pass), child_one_surface_id); |
| 911 | 911 |
| 912 SurfaceId child_two_surface_id = allocator_.GenerateId(); | 912 SurfaceId child_two_surface_id = allocator_.GenerateId(); |
| 913 factory_.Create(child_two_surface_id); | 913 factory_.Create(child_two_surface_id); |
| 914 Surface* child_two_surface = manager_.GetSurfaceForId(child_two_surface_id); | 914 Surface* child_two_surface = manager_.GetSurfaceForId(child_two_surface_id); |
| 915 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_two_surface)); | 915 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_two_surface)); |
| 916 | 916 |
| 917 scoped_ptr<RenderPass> child_two_pass = RenderPass::Create(); | 917 scoped_ptr<RenderPass> child_two_pass = RenderPass::Create(); |
| 918 child_two_pass->SetNew( | 918 child_two_pass->SetNew( |
| 919 pass_id, output_rect, damage_rect, transform_to_root_target); | 919 pass_id, output_rect, damage_rect, transform_to_root_target); |
| 920 AddSolidColorQuadWithBlendMode( | 920 AddSolidColorQuadWithBlendMode( |
| 921 SurfaceSize(), child_two_pass.get(), blend_modes[5]); | 921 SurfaceSize(), child_two_pass.get(), blend_modes[5]); |
| 922 QueuePassAsFrame(child_two_pass.Pass(), child_two_surface_id); | 922 QueuePassAsFrame(std::move(child_two_pass), child_two_surface_id); |
| 923 | 923 |
| 924 scoped_ptr<RenderPass> root_pass = RenderPass::Create(); | 924 scoped_ptr<RenderPass> root_pass = RenderPass::Create(); |
| 925 root_pass->SetNew( | 925 root_pass->SetNew( |
| 926 pass_id, output_rect, damage_rect, transform_to_root_target); | 926 pass_id, output_rect, damage_rect, transform_to_root_target); |
| 927 | 927 |
| 928 AddSolidColorQuadWithBlendMode( | 928 AddSolidColorQuadWithBlendMode( |
| 929 SurfaceSize(), root_pass.get(), blend_modes[0]); | 929 SurfaceSize(), root_pass.get(), blend_modes[0]); |
| 930 SurfaceDrawQuad* child_one_surface_quad = | 930 SurfaceDrawQuad* child_one_surface_quad = |
| 931 root_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 931 root_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
| 932 child_one_surface_quad->SetNew(root_pass->shared_quad_state_list.back(), | 932 child_one_surface_quad->SetNew(root_pass->shared_quad_state_list.back(), |
| 933 gfx::Rect(SurfaceSize()), | 933 gfx::Rect(SurfaceSize()), |
| 934 gfx::Rect(SurfaceSize()), | 934 gfx::Rect(SurfaceSize()), |
| 935 child_one_surface_id); | 935 child_one_surface_id); |
| 936 AddSolidColorQuadWithBlendMode( | 936 AddSolidColorQuadWithBlendMode( |
| 937 SurfaceSize(), root_pass.get(), blend_modes[4]); | 937 SurfaceSize(), root_pass.get(), blend_modes[4]); |
| 938 SurfaceDrawQuad* child_two_surface_quad = | 938 SurfaceDrawQuad* child_two_surface_quad = |
| 939 root_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 939 root_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
| 940 child_two_surface_quad->SetNew(root_pass->shared_quad_state_list.back(), | 940 child_two_surface_quad->SetNew(root_pass->shared_quad_state_list.back(), |
| 941 gfx::Rect(SurfaceSize()), | 941 gfx::Rect(SurfaceSize()), |
| 942 gfx::Rect(SurfaceSize()), | 942 gfx::Rect(SurfaceSize()), |
| 943 child_two_surface_id); | 943 child_two_surface_id); |
| 944 AddSolidColorQuadWithBlendMode( | 944 AddSolidColorQuadWithBlendMode( |
| 945 SurfaceSize(), root_pass.get(), blend_modes[6]); | 945 SurfaceSize(), root_pass.get(), blend_modes[6]); |
| 946 | 946 |
| 947 QueuePassAsFrame(root_pass.Pass(), root_surface_id_); | 947 QueuePassAsFrame(std::move(root_pass), root_surface_id_); |
| 948 | 948 |
| 949 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); | 949 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); |
| 950 EXPECT_FALSE(surface_aggregator_client_.HasSurface(grandchild_surface)); | 950 EXPECT_FALSE(surface_aggregator_client_.HasSurface(grandchild_surface)); |
| 951 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_one_surface)); | 951 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_one_surface)); |
| 952 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_two_surface)); | 952 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_two_surface)); |
| 953 | 953 |
| 954 scoped_ptr<CompositorFrame> aggregated_frame = | 954 scoped_ptr<CompositorFrame> aggregated_frame = |
| 955 aggregator_.Aggregate(root_surface_id_); | 955 aggregator_.Aggregate(root_surface_id_); |
| 956 | 956 |
| 957 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 957 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 SharedQuadState* child_root_pass_sqs = | 1032 SharedQuadState* child_root_pass_sqs = |
| 1033 child_root_pass->shared_quad_state_list.front(); | 1033 child_root_pass->shared_quad_state_list.front(); |
| 1034 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); | 1034 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); |
| 1035 child_root_pass_sqs->is_clipped = true; | 1035 child_root_pass_sqs->is_clipped = true; |
| 1036 child_root_pass_sqs->clip_rect = gfx::Rect(0, 0, 5, 5); | 1036 child_root_pass_sqs->clip_rect = gfx::Rect(0, 0, 5, 5); |
| 1037 | 1037 |
| 1038 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 1038 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 1039 child_pass_list.swap(child_frame_data->render_pass_list); | 1039 child_pass_list.swap(child_frame_data->render_pass_list); |
| 1040 | 1040 |
| 1041 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 1041 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 1042 child_frame->delegated_frame_data = child_frame_data.Pass(); | 1042 child_frame->delegated_frame_data = std::move(child_frame_data); |
| 1043 | 1043 |
| 1044 factory_.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), | 1044 factory_.SubmitCompositorFrame(child_surface_id, std::move(child_frame), |
| 1045 SurfaceFactory::DrawCallback()); | 1045 SurfaceFactory::DrawCallback()); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 // Middle child surface. | 1048 // Middle child surface. |
| 1049 SurfaceId middle_surface_id = allocator_.GenerateId(); | 1049 SurfaceId middle_surface_id = allocator_.GenerateId(); |
| 1050 factory_.Create(middle_surface_id); | 1050 factory_.Create(middle_surface_id); |
| 1051 Surface* middle_surface = manager_.GetSurfaceForId(middle_surface_id); | 1051 Surface* middle_surface = manager_.GetSurfaceForId(middle_surface_id); |
| 1052 EXPECT_FALSE(surface_aggregator_client_.HasSurface(middle_surface)); | 1052 EXPECT_FALSE(surface_aggregator_client_.HasSurface(middle_surface)); |
| 1053 { | 1053 { |
| 1054 test::Quad middle_quads[] = { | 1054 test::Quad middle_quads[] = { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1065 middle_root_pass->quad_list.ElementAt(0)->visible_rect = | 1065 middle_root_pass->quad_list.ElementAt(0)->visible_rect = |
| 1066 gfx::Rect(0, 1, 100, 7); | 1066 gfx::Rect(0, 1, 100, 7); |
| 1067 SharedQuadState* middle_root_pass_sqs = | 1067 SharedQuadState* middle_root_pass_sqs = |
| 1068 middle_root_pass->shared_quad_state_list.front(); | 1068 middle_root_pass->shared_quad_state_list.front(); |
| 1069 middle_root_pass_sqs->quad_to_target_transform.Scale(2, 3); | 1069 middle_root_pass_sqs->quad_to_target_transform.Scale(2, 3); |
| 1070 | 1070 |
| 1071 scoped_ptr<DelegatedFrameData> middle_frame_data(new DelegatedFrameData); | 1071 scoped_ptr<DelegatedFrameData> middle_frame_data(new DelegatedFrameData); |
| 1072 middle_pass_list.swap(middle_frame_data->render_pass_list); | 1072 middle_pass_list.swap(middle_frame_data->render_pass_list); |
| 1073 | 1073 |
| 1074 scoped_ptr<CompositorFrame> middle_frame(new CompositorFrame); | 1074 scoped_ptr<CompositorFrame> middle_frame(new CompositorFrame); |
| 1075 middle_frame->delegated_frame_data = middle_frame_data.Pass(); | 1075 middle_frame->delegated_frame_data = std::move(middle_frame_data); |
| 1076 | 1076 |
| 1077 factory_.SubmitCompositorFrame(middle_surface_id, middle_frame.Pass(), | 1077 factory_.SubmitCompositorFrame(middle_surface_id, std::move(middle_frame), |
| 1078 SurfaceFactory::DrawCallback()); | 1078 SurfaceFactory::DrawCallback()); |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 // Root surface. | 1081 // Root surface. |
| 1082 test::Quad secondary_quads[] = { | 1082 test::Quad secondary_quads[] = { |
| 1083 test::Quad::SolidColorQuad(1), | 1083 test::Quad::SolidColorQuad(1), |
| 1084 test::Quad::SurfaceQuad(middle_surface_id, 1.f)}; | 1084 test::Quad::SurfaceQuad(middle_surface_id, 1.f)}; |
| 1085 test::Quad root_quads[] = {test::Quad::SolidColorQuad(1)}; | 1085 test::Quad root_quads[] = {test::Quad::SolidColorQuad(1)}; |
| 1086 test::Pass root_passes[] = { | 1086 test::Pass root_passes[] = { |
| 1087 test::Pass(secondary_quads, arraysize(secondary_quads)), | 1087 test::Pass(secondary_quads, arraysize(secondary_quads)), |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1101 ->quad_to_target_transform.Translate(0, 10); | 1101 ->quad_to_target_transform.Translate(0, 10); |
| 1102 root_pass_list[0]->quad_list.ElementAt(1)->visible_rect = | 1102 root_pass_list[0]->quad_list.ElementAt(1)->visible_rect = |
| 1103 gfx::Rect(0, 0, 8, 100); | 1103 gfx::Rect(0, 0, 8, 100); |
| 1104 | 1104 |
| 1105 root_pass_list[0]->transform_to_root_target.Translate(10, 5); | 1105 root_pass_list[0]->transform_to_root_target.Translate(10, 5); |
| 1106 | 1106 |
| 1107 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1107 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1108 root_pass_list.swap(root_frame_data->render_pass_list); | 1108 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1109 | 1109 |
| 1110 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1110 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1111 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1111 root_frame->delegated_frame_data = std::move(root_frame_data); |
| 1112 | 1112 |
| 1113 factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), | 1113 factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), |
| 1114 SurfaceFactory::DrawCallback()); | 1114 SurfaceFactory::DrawCallback()); |
| 1115 | 1115 |
| 1116 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); | 1116 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); |
| 1117 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_surface)); | 1117 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_surface)); |
| 1118 EXPECT_FALSE(surface_aggregator_client_.HasSurface(middle_surface)); | 1118 EXPECT_FALSE(surface_aggregator_client_.HasSurface(middle_surface)); |
| 1119 | 1119 |
| 1120 scoped_ptr<CompositorFrame> aggregated_frame = | 1120 scoped_ptr<CompositorFrame> aggregated_frame = |
| 1121 aggregator_.Aggregate(root_surface_id_); | 1121 aggregator_.Aggregate(root_surface_id_); |
| 1122 | 1122 |
| 1123 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 1123 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 | 1216 |
| 1217 RenderPass* child_root_pass = child_pass_list[0].get(); | 1217 RenderPass* child_root_pass = child_pass_list[0].get(); |
| 1218 SharedQuadState* child_root_pass_sqs = | 1218 SharedQuadState* child_root_pass_sqs = |
| 1219 child_root_pass->shared_quad_state_list.front(); | 1219 child_root_pass->shared_quad_state_list.front(); |
| 1220 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); | 1220 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); |
| 1221 | 1221 |
| 1222 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 1222 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 1223 child_pass_list.swap(child_frame_data->render_pass_list); | 1223 child_pass_list.swap(child_frame_data->render_pass_list); |
| 1224 | 1224 |
| 1225 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 1225 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 1226 child_frame->delegated_frame_data = child_frame_data.Pass(); | 1226 child_frame->delegated_frame_data = std::move(child_frame_data); |
| 1227 | 1227 |
| 1228 SurfaceId child_surface_id = allocator_.GenerateId(); | 1228 SurfaceId child_surface_id = allocator_.GenerateId(); |
| 1229 factory_.Create(child_surface_id); | 1229 factory_.Create(child_surface_id); |
| 1230 Surface* child_surface = manager_.GetSurfaceForId(child_surface_id); | 1230 Surface* child_surface = manager_.GetSurfaceForId(child_surface_id); |
| 1231 factory_.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), | 1231 factory_.SubmitCompositorFrame(child_surface_id, std::move(child_frame), |
| 1232 SurfaceFactory::DrawCallback()); | 1232 SurfaceFactory::DrawCallback()); |
| 1233 | 1233 |
| 1234 test::Quad parent_surface_quads[] = { | 1234 test::Quad parent_surface_quads[] = { |
| 1235 test::Quad::SurfaceQuad(child_surface_id, 1.f)}; | 1235 test::Quad::SurfaceQuad(child_surface_id, 1.f)}; |
| 1236 test::Pass parent_surface_passes[] = { | 1236 test::Pass parent_surface_passes[] = { |
| 1237 test::Pass(parent_surface_quads, arraysize(parent_surface_quads), | 1237 test::Pass(parent_surface_quads, arraysize(parent_surface_quads), |
| 1238 RenderPassId(1, 1))}; | 1238 RenderPassId(1, 1))}; |
| 1239 | 1239 |
| 1240 RenderPassList parent_surface_pass_list; | 1240 RenderPassList parent_surface_pass_list; |
| 1241 AddPasses(&parent_surface_pass_list, | 1241 AddPasses(&parent_surface_pass_list, |
| 1242 gfx::Rect(SurfaceSize()), | 1242 gfx::Rect(SurfaceSize()), |
| 1243 parent_surface_passes, | 1243 parent_surface_passes, |
| 1244 arraysize(parent_surface_passes)); | 1244 arraysize(parent_surface_passes)); |
| 1245 | 1245 |
| 1246 // Parent surface is only used to test if the transform is applied correctly | 1246 // Parent surface is only used to test if the transform is applied correctly |
| 1247 // to the child surface's damage. | 1247 // to the child surface's damage. |
| 1248 scoped_ptr<DelegatedFrameData> parent_surface_frame_data( | 1248 scoped_ptr<DelegatedFrameData> parent_surface_frame_data( |
| 1249 new DelegatedFrameData); | 1249 new DelegatedFrameData); |
| 1250 parent_surface_pass_list.swap(parent_surface_frame_data->render_pass_list); | 1250 parent_surface_pass_list.swap(parent_surface_frame_data->render_pass_list); |
| 1251 | 1251 |
| 1252 scoped_ptr<CompositorFrame> parent_surface_frame(new CompositorFrame); | 1252 scoped_ptr<CompositorFrame> parent_surface_frame(new CompositorFrame); |
| 1253 parent_surface_frame->delegated_frame_data = parent_surface_frame_data.Pass(); | 1253 parent_surface_frame->delegated_frame_data = |
| 1254 std::move(parent_surface_frame_data); |
| 1254 | 1255 |
| 1255 SurfaceId parent_surface_id = allocator_.GenerateId(); | 1256 SurfaceId parent_surface_id = allocator_.GenerateId(); |
| 1256 factory_.Create(parent_surface_id); | 1257 factory_.Create(parent_surface_id); |
| 1257 Surface* parent_surface = manager_.GetSurfaceForId(parent_surface_id); | 1258 Surface* parent_surface = manager_.GetSurfaceForId(parent_surface_id); |
| 1258 factory_.SubmitCompositorFrame(parent_surface_id, parent_surface_frame.Pass(), | 1259 factory_.SubmitCompositorFrame(parent_surface_id, |
| 1260 std::move(parent_surface_frame), |
| 1259 SurfaceFactory::DrawCallback()); | 1261 SurfaceFactory::DrawCallback()); |
| 1260 | 1262 |
| 1261 test::Quad root_surface_quads[] = { | 1263 test::Quad root_surface_quads[] = { |
| 1262 test::Quad::SurfaceQuad(parent_surface_id, 1.f)}; | 1264 test::Quad::SurfaceQuad(parent_surface_id, 1.f)}; |
| 1263 test::Quad root_render_pass_quads[] = { | 1265 test::Quad root_render_pass_quads[] = { |
| 1264 test::Quad::RenderPassQuad(RenderPassId(1, 1))}; | 1266 test::Quad::RenderPassQuad(RenderPassId(1, 1))}; |
| 1265 | 1267 |
| 1266 test::Pass root_passes[] = { | 1268 test::Pass root_passes[] = { |
| 1267 test::Pass(root_surface_quads, arraysize(root_surface_quads), | 1269 test::Pass(root_surface_quads, arraysize(root_surface_quads), |
| 1268 RenderPassId(1, 1)), | 1270 RenderPassId(1, 1)), |
| 1269 test::Pass(root_render_pass_quads, arraysize(root_render_pass_quads), | 1271 test::Pass(root_render_pass_quads, arraysize(root_render_pass_quads), |
| 1270 RenderPassId(2, 1))}; | 1272 RenderPassId(2, 1))}; |
| 1271 | 1273 |
| 1272 RenderPassList root_pass_list; | 1274 RenderPassList root_pass_list; |
| 1273 AddPasses(&root_pass_list, | 1275 AddPasses(&root_pass_list, |
| 1274 gfx::Rect(SurfaceSize()), | 1276 gfx::Rect(SurfaceSize()), |
| 1275 root_passes, | 1277 root_passes, |
| 1276 arraysize(root_passes)); | 1278 arraysize(root_passes)); |
| 1277 | 1279 |
| 1278 root_pass_list[0] | 1280 root_pass_list[0] |
| 1279 ->shared_quad_state_list.front() | 1281 ->shared_quad_state_list.front() |
| 1280 ->quad_to_target_transform.Translate(0, 10); | 1282 ->quad_to_target_transform.Translate(0, 10); |
| 1281 root_pass_list[0]->damage_rect = gfx::Rect(5, 5, 10, 10); | 1283 root_pass_list[0]->damage_rect = gfx::Rect(5, 5, 10, 10); |
| 1282 root_pass_list[1]->damage_rect = gfx::Rect(5, 5, 100, 100); | 1284 root_pass_list[1]->damage_rect = gfx::Rect(5, 5, 100, 100); |
| 1283 | 1285 |
| 1284 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1286 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1285 root_pass_list.swap(root_frame_data->render_pass_list); | 1287 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1286 | 1288 |
| 1287 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1289 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1288 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1290 root_frame->delegated_frame_data = std::move(root_frame_data); |
| 1289 | 1291 |
| 1290 factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), | 1292 factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), |
| 1291 SurfaceFactory::DrawCallback()); | 1293 SurfaceFactory::DrawCallback()); |
| 1292 | 1294 |
| 1293 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); | 1295 EXPECT_FALSE(surface_aggregator_client_.HasSurface(root_surface_)); |
| 1294 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_surface)); | 1296 EXPECT_FALSE(surface_aggregator_client_.HasSurface(child_surface)); |
| 1295 EXPECT_FALSE(surface_aggregator_client_.HasSurface(parent_surface)); | 1297 EXPECT_FALSE(surface_aggregator_client_.HasSurface(parent_surface)); |
| 1296 | 1298 |
| 1297 scoped_ptr<CompositorFrame> aggregated_frame = | 1299 scoped_ptr<CompositorFrame> aggregated_frame = |
| 1298 aggregator_.Aggregate(root_surface_id_); | 1300 aggregator_.Aggregate(root_surface_id_); |
| 1299 | 1301 |
| 1300 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 1302 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1323 RenderPass* child_root_pass = child_pass_list[0].get(); | 1325 RenderPass* child_root_pass = child_pass_list[0].get(); |
| 1324 SharedQuadState* child_root_pass_sqs = | 1326 SharedQuadState* child_root_pass_sqs = |
| 1325 child_root_pass->shared_quad_state_list.front(); | 1327 child_root_pass->shared_quad_state_list.front(); |
| 1326 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); | 1328 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); |
| 1327 child_root_pass->damage_rect = gfx::Rect(10, 10, 10, 10); | 1329 child_root_pass->damage_rect = gfx::Rect(10, 10, 10, 10); |
| 1328 | 1330 |
| 1329 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 1331 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 1330 child_pass_list.swap(child_frame_data->render_pass_list); | 1332 child_pass_list.swap(child_frame_data->render_pass_list); |
| 1331 | 1333 |
| 1332 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 1334 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 1333 child_frame->delegated_frame_data = child_frame_data.Pass(); | 1335 child_frame->delegated_frame_data = std::move(child_frame_data); |
| 1334 | 1336 |
| 1335 factory_.SubmitCompositorFrame(child_surface_id, child_frame.Pass(), | 1337 factory_.SubmitCompositorFrame(child_surface_id, std::move(child_frame), |
| 1336 SurfaceFactory::DrawCallback()); | 1338 SurfaceFactory::DrawCallback()); |
| 1337 | 1339 |
| 1338 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 1340 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| 1339 EXPECT_TRUE(surface_aggregator_client_.HasSurface(child_surface)); | 1341 EXPECT_TRUE(surface_aggregator_client_.HasSurface(child_surface)); |
| 1340 EXPECT_TRUE(surface_aggregator_client_.HasSurface(parent_surface)); | 1342 EXPECT_TRUE(surface_aggregator_client_.HasSurface(parent_surface)); |
| 1341 | 1343 |
| 1342 scoped_ptr<CompositorFrame> aggregated_frame = | 1344 scoped_ptr<CompositorFrame> aggregated_frame = |
| 1343 aggregator_.Aggregate(root_surface_id_); | 1345 aggregator_.Aggregate(root_surface_id_); |
| 1344 | 1346 |
| 1345 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 1347 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1371 | 1373 |
| 1372 root_pass_list[0] | 1374 root_pass_list[0] |
| 1373 ->shared_quad_state_list.front() | 1375 ->shared_quad_state_list.front() |
| 1374 ->quad_to_target_transform.Translate(0, 10); | 1376 ->quad_to_target_transform.Translate(0, 10); |
| 1375 root_pass_list[0]->damage_rect = gfx::Rect(0, 0, 1, 1); | 1377 root_pass_list[0]->damage_rect = gfx::Rect(0, 0, 1, 1); |
| 1376 | 1378 |
| 1377 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1379 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1378 root_pass_list.swap(root_frame_data->render_pass_list); | 1380 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1379 | 1381 |
| 1380 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1382 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1381 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1383 root_frame->delegated_frame_data = std::move(root_frame_data); |
| 1382 | 1384 |
| 1383 factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), | 1385 factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), |
| 1384 SurfaceFactory::DrawCallback()); | 1386 SurfaceFactory::DrawCallback()); |
| 1385 } | 1387 } |
| 1386 | 1388 |
| 1387 { | 1389 { |
| 1388 RenderPassList root_pass_list; | 1390 RenderPassList root_pass_list; |
| 1389 AddPasses(&root_pass_list, | 1391 AddPasses(&root_pass_list, |
| 1390 gfx::Rect(SurfaceSize()), | 1392 gfx::Rect(SurfaceSize()), |
| 1391 root_passes, | 1393 root_passes, |
| 1392 arraysize(root_passes)); | 1394 arraysize(root_passes)); |
| 1393 | 1395 |
| 1394 root_pass_list[0] | 1396 root_pass_list[0] |
| 1395 ->shared_quad_state_list.front() | 1397 ->shared_quad_state_list.front() |
| 1396 ->quad_to_target_transform.Translate(0, 10); | 1398 ->quad_to_target_transform.Translate(0, 10); |
| 1397 root_pass_list[0]->damage_rect = gfx::Rect(1, 1, 1, 1); | 1399 root_pass_list[0]->damage_rect = gfx::Rect(1, 1, 1, 1); |
| 1398 | 1400 |
| 1399 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1401 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1400 root_pass_list.swap(root_frame_data->render_pass_list); | 1402 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1401 | 1403 |
| 1402 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1404 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1403 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1405 root_frame->delegated_frame_data = std::move(root_frame_data); |
| 1404 | 1406 |
| 1405 factory_.SubmitCompositorFrame(root_surface_id_, root_frame.Pass(), | 1407 factory_.SubmitCompositorFrame(root_surface_id_, std::move(root_frame), |
| 1406 SurfaceFactory::DrawCallback()); | 1408 SurfaceFactory::DrawCallback()); |
| 1407 | 1409 |
| 1408 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 1410 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| 1409 EXPECT_TRUE(surface_aggregator_client_.HasSurface(child_surface)); | 1411 EXPECT_TRUE(surface_aggregator_client_.HasSurface(child_surface)); |
| 1410 EXPECT_TRUE(surface_aggregator_client_.HasSurface(parent_surface)); | 1412 EXPECT_TRUE(surface_aggregator_client_.HasSurface(parent_surface)); |
| 1411 | 1413 |
| 1412 scoped_ptr<CompositorFrame> aggregated_frame = | 1414 scoped_ptr<CompositorFrame> aggregated_frame = |
| 1413 aggregator_.Aggregate(root_surface_id_); | 1415 aggregator_.Aggregate(root_surface_id_); |
| 1414 | 1416 |
| 1415 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); | 1417 EXPECT_TRUE(surface_aggregator_client_.HasSurface(root_surface_)); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 const gfx::PointF uv_bottom_right; | 1789 const gfx::PointF uv_bottom_right; |
| 1788 SkColor background_color = SK_ColorGREEN; | 1790 SkColor background_color = SK_ColorGREEN; |
| 1789 const float vertex_opacity[4] = {0.f, 0.f, 1.f, 1.f}; | 1791 const float vertex_opacity[4] = {0.f, 0.f, 1.f, 1.f}; |
| 1790 bool flipped = false; | 1792 bool flipped = false; |
| 1791 bool nearest_neighbor = false; | 1793 bool nearest_neighbor = false; |
| 1792 quad->SetAll(sqs, rect, opaque_rect, visible_rect, needs_blending, | 1794 quad->SetAll(sqs, rect, opaque_rect, visible_rect, needs_blending, |
| 1793 resource_ids[i], gfx::Size(), premultiplied_alpha, uv_top_left, | 1795 resource_ids[i], gfx::Size(), premultiplied_alpha, uv_top_left, |
| 1794 uv_bottom_right, background_color, vertex_opacity, flipped, | 1796 uv_bottom_right, background_color, vertex_opacity, flipped, |
| 1795 nearest_neighbor); | 1797 nearest_neighbor); |
| 1796 } | 1798 } |
| 1797 frame_data->render_pass_list.push_back(pass.Pass()); | 1799 frame_data->render_pass_list.push_back(std::move(pass)); |
| 1798 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 1800 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 1799 frame->delegated_frame_data = frame_data.Pass(); | 1801 frame->delegated_frame_data = std::move(frame_data); |
| 1800 factory->SubmitCompositorFrame(surface_id, frame.Pass(), | 1802 factory->SubmitCompositorFrame(surface_id, std::move(frame), |
| 1801 SurfaceFactory::DrawCallback()); | 1803 SurfaceFactory::DrawCallback()); |
| 1802 } | 1804 } |
| 1803 | 1805 |
| 1804 TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) { | 1806 TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) { |
| 1805 ResourceTrackingSurfaceFactoryClient client; | 1807 ResourceTrackingSurfaceFactoryClient client; |
| 1806 SurfaceFactory factory(&manager_, &client); | 1808 SurfaceFactory factory(&manager_, &client); |
| 1807 SurfaceId surface_id(7u); | 1809 SurfaceId surface_id(7u); |
| 1808 factory.Create(surface_id); | 1810 factory.Create(surface_id); |
| 1809 Surface* surface = manager_.GetSurfaceForId(surface_id); | 1811 Surface* surface = manager_.GetSurfaceForId(surface_id); |
| 1810 | 1812 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1849 | 1851 |
| 1850 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 1852 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 1851 scoped_ptr<RenderPass> pass = RenderPass::Create(); | 1853 scoped_ptr<RenderPass> pass = RenderPass::Create(); |
| 1852 pass->id = RenderPassId(1, 1); | 1854 pass->id = RenderPassId(1, 1); |
| 1853 TransferableResource resource; | 1855 TransferableResource resource; |
| 1854 resource.id = 11; | 1856 resource.id = 11; |
| 1855 // ResourceProvider is software but resource is not, so it should be | 1857 // ResourceProvider is software but resource is not, so it should be |
| 1856 // ignored. | 1858 // ignored. |
| 1857 resource.is_software = false; | 1859 resource.is_software = false; |
| 1858 frame_data->resource_list.push_back(resource); | 1860 frame_data->resource_list.push_back(resource); |
| 1859 frame_data->render_pass_list.push_back(pass.Pass()); | 1861 frame_data->render_pass_list.push_back(std::move(pass)); |
| 1860 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 1862 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 1861 frame->delegated_frame_data = frame_data.Pass(); | 1863 frame->delegated_frame_data = std::move(frame_data); |
| 1862 factory.SubmitCompositorFrame(surface_id, frame.Pass(), | 1864 factory.SubmitCompositorFrame(surface_id, std::move(frame), |
| 1863 SurfaceFactory::DrawCallback()); | 1865 SurfaceFactory::DrawCallback()); |
| 1864 | 1866 |
| 1865 EXPECT_FALSE(surface_aggregator_client_.HasSurface(surface)); | 1867 EXPECT_FALSE(surface_aggregator_client_.HasSurface(surface)); |
| 1866 | 1868 |
| 1867 scoped_ptr<CompositorFrame> returned_frame = | 1869 scoped_ptr<CompositorFrame> returned_frame = |
| 1868 aggregator_->Aggregate(surface_id); | 1870 aggregator_->Aggregate(surface_id); |
| 1869 | 1871 |
| 1870 EXPECT_TRUE(surface_aggregator_client_.HasSurface(surface)); | 1872 EXPECT_TRUE(surface_aggregator_client_.HasSurface(surface)); |
| 1871 | 1873 |
| 1872 // Nothing should be available to be returned yet. | 1874 // Nothing should be available to be returned yet. |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1998 EXPECT_EQ(9u, pass_list->back()->quad_list.size()); | 2000 EXPECT_EQ(9u, pass_list->back()->quad_list.size()); |
| 1999 | 2001 |
| 2000 factory.Destroy(root_surface_id); | 2002 factory.Destroy(root_surface_id); |
| 2001 factory.Destroy(child_surface_id); | 2003 factory.Destroy(child_surface_id); |
| 2002 factory.Destroy(middle_surface_id); | 2004 factory.Destroy(middle_surface_id); |
| 2003 } | 2005 } |
| 2004 | 2006 |
| 2005 } // namespace | 2007 } // namespace |
| 2006 } // namespace cc | 2008 } // namespace cc |
| 2007 | 2009 |
| OLD | NEW |