| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 SurfaceId surface_id) { | 116 SurfaceId surface_id) { |
| 117 RenderPassList pass_list; | 117 RenderPassList pass_list; |
| 118 AddPasses(&pass_list, gfx::Rect(SurfaceSize()), passes, pass_count); | 118 AddPasses(&pass_list, gfx::Rect(SurfaceSize()), passes, pass_count); |
| 119 | 119 |
| 120 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 120 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 121 pass_list.swap(frame_data->render_pass_list); | 121 pass_list.swap(frame_data->render_pass_list); |
| 122 | 122 |
| 123 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 123 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 124 frame->delegated_frame_data = frame_data.Pass(); | 124 frame->delegated_frame_data = frame_data.Pass(); |
| 125 | 125 |
| 126 factory_.SubmitFrame(surface_id, frame.Pass(), base::Closure()); | 126 factory_.SubmitFrame(surface_id, frame.Pass(), |
| 127 SurfaceFactory::DrawCallback()); |
| 127 } | 128 } |
| 128 | 129 |
| 129 void QueuePassAsFrame(scoped_ptr<RenderPass> pass, SurfaceId surface_id) { | 130 void QueuePassAsFrame(scoped_ptr<RenderPass> pass, SurfaceId surface_id) { |
| 130 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); | 131 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); |
| 131 delegated_frame_data->render_pass_list.push_back(pass.Pass()); | 132 delegated_frame_data->render_pass_list.push_back(pass.Pass()); |
| 132 | 133 |
| 133 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 134 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 134 child_frame->delegated_frame_data = delegated_frame_data.Pass(); | 135 child_frame->delegated_frame_data = delegated_frame_data.Pass(); |
| 135 | 136 |
| 136 factory_.SubmitFrame(surface_id, child_frame.Pass(), base::Closure()); | 137 factory_.SubmitFrame(surface_id, child_frame.Pass(), |
| 138 SurfaceFactory::DrawCallback()); |
| 137 } | 139 } |
| 138 | 140 |
| 139 protected: | 141 protected: |
| 140 SurfaceId root_surface_id_; | 142 SurfaceId root_surface_id_; |
| 141 SurfaceIdAllocator allocator_; | 143 SurfaceIdAllocator allocator_; |
| 142 SurfaceIdAllocator child_allocator_; | 144 SurfaceIdAllocator child_allocator_; |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 // Tests that a very simple frame containing only two solid color quads makes it | 147 // Tests that a very simple frame containing only two solid color quads makes it |
| 146 // through the aggregator correctly. | 148 // through the aggregator correctly. |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 arraysize(root_passes)); | 375 arraysize(root_passes)); |
| 374 pass_list[0]->copy_requests.push_back(copy_request.Pass()); | 376 pass_list[0]->copy_requests.push_back(copy_request.Pass()); |
| 375 pass_list[1]->copy_requests.push_back(copy_request2.Pass()); | 377 pass_list[1]->copy_requests.push_back(copy_request2.Pass()); |
| 376 | 378 |
| 377 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 379 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 378 pass_list.swap(frame_data->render_pass_list); | 380 pass_list.swap(frame_data->render_pass_list); |
| 379 | 381 |
| 380 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 382 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 381 frame->delegated_frame_data = frame_data.Pass(); | 383 frame->delegated_frame_data = frame_data.Pass(); |
| 382 | 384 |
| 383 factory_.SubmitFrame(root_surface_id_, frame.Pass(), base::Closure()); | 385 factory_.SubmitFrame(root_surface_id_, frame.Pass(), |
| 386 SurfaceFactory::DrawCallback()); |
| 384 } | 387 } |
| 385 | 388 |
| 386 scoped_ptr<CompositorFrame> aggregated_frame = | 389 scoped_ptr<CompositorFrame> aggregated_frame = |
| 387 aggregator_.Aggregate(root_surface_id_); | 390 aggregator_.Aggregate(root_surface_id_); |
| 388 | 391 |
| 389 ASSERT_TRUE(aggregated_frame); | 392 ASSERT_TRUE(aggregated_frame); |
| 390 ASSERT_TRUE(aggregated_frame->delegated_frame_data); | 393 ASSERT_TRUE(aggregated_frame->delegated_frame_data); |
| 391 | 394 |
| 392 DelegatedFrameData* frame_data = aggregated_frame->delegated_frame_data.get(); | 395 DelegatedFrameData* frame_data = aggregated_frame->delegated_frame_data.get(); |
| 393 | 396 |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); | 933 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); |
| 931 child_root_pass_sqs->is_clipped = true; | 934 child_root_pass_sqs->is_clipped = true; |
| 932 child_root_pass_sqs->clip_rect = gfx::Rect(0, 0, 5, 5); | 935 child_root_pass_sqs->clip_rect = gfx::Rect(0, 0, 5, 5); |
| 933 | 936 |
| 934 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 937 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 935 child_pass_list.swap(child_frame_data->render_pass_list); | 938 child_pass_list.swap(child_frame_data->render_pass_list); |
| 936 | 939 |
| 937 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 940 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 938 child_frame->delegated_frame_data = child_frame_data.Pass(); | 941 child_frame->delegated_frame_data = child_frame_data.Pass(); |
| 939 | 942 |
| 940 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), base::Closure()); | 943 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), |
| 944 SurfaceFactory::DrawCallback()); |
| 941 | 945 |
| 942 test::Quad root_quads[] = {test::Quad::SolidColorQuad(1), | 946 test::Quad root_quads[] = {test::Quad::SolidColorQuad(1), |
| 943 test::Quad::SurfaceQuad(child_surface_id, 1.f)}; | 947 test::Quad::SurfaceQuad(child_surface_id, 1.f)}; |
| 944 test::Pass root_passes[] = {test::Pass(root_quads, arraysize(root_quads))}; | 948 test::Pass root_passes[] = {test::Pass(root_quads, arraysize(root_quads))}; |
| 945 | 949 |
| 946 RenderPassList root_pass_list; | 950 RenderPassList root_pass_list; |
| 947 AddPasses(&root_pass_list, | 951 AddPasses(&root_pass_list, |
| 948 gfx::Rect(SurfaceSize()), | 952 gfx::Rect(SurfaceSize()), |
| 949 root_passes, | 953 root_passes, |
| 950 arraysize(root_passes)); | 954 arraysize(root_passes)); |
| 951 | 955 |
| 952 root_pass_list.at(0) | 956 root_pass_list.at(0) |
| 953 ->shared_quad_state_list.front() | 957 ->shared_quad_state_list.front() |
| 954 ->content_to_target_transform.Translate(0, 7); | 958 ->content_to_target_transform.Translate(0, 7); |
| 955 root_pass_list.at(0) | 959 root_pass_list.at(0) |
| 956 ->shared_quad_state_list.ElementAt(1) | 960 ->shared_quad_state_list.ElementAt(1) |
| 957 ->content_to_target_transform.Translate(0, 10); | 961 ->content_to_target_transform.Translate(0, 10); |
| 958 | 962 |
| 959 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 963 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 960 root_pass_list.swap(root_frame_data->render_pass_list); | 964 root_pass_list.swap(root_frame_data->render_pass_list); |
| 961 | 965 |
| 962 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 966 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 963 root_frame->delegated_frame_data = root_frame_data.Pass(); | 967 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| 964 | 968 |
| 965 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), base::Closure()); | 969 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), |
| 970 SurfaceFactory::DrawCallback()); |
| 966 | 971 |
| 967 scoped_ptr<CompositorFrame> aggregated_frame = | 972 scoped_ptr<CompositorFrame> aggregated_frame = |
| 968 aggregator_.Aggregate(root_surface_id_); | 973 aggregator_.Aggregate(root_surface_id_); |
| 969 | 974 |
| 970 ASSERT_TRUE(aggregated_frame); | 975 ASSERT_TRUE(aggregated_frame); |
| 971 ASSERT_TRUE(aggregated_frame->delegated_frame_data); | 976 ASSERT_TRUE(aggregated_frame->delegated_frame_data); |
| 972 | 977 |
| 973 DelegatedFrameData* frame_data = aggregated_frame->delegated_frame_data.get(); | 978 DelegatedFrameData* frame_data = aggregated_frame->delegated_frame_data.get(); |
| 974 | 979 |
| 975 const RenderPassList& aggregated_pass_list = frame_data->render_pass_list; | 980 const RenderPassList& aggregated_pass_list = frame_data->render_pass_list; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 SharedQuadState* child_root_pass_sqs = | 1059 SharedQuadState* child_root_pass_sqs = |
| 1055 child_root_pass->shared_quad_state_list.front(); | 1060 child_root_pass->shared_quad_state_list.front(); |
| 1056 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); | 1061 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); |
| 1057 | 1062 |
| 1058 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 1063 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 1059 child_pass_list.swap(child_frame_data->render_pass_list); | 1064 child_pass_list.swap(child_frame_data->render_pass_list); |
| 1060 | 1065 |
| 1061 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 1066 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 1062 child_frame->delegated_frame_data = child_frame_data.Pass(); | 1067 child_frame->delegated_frame_data = child_frame_data.Pass(); |
| 1063 | 1068 |
| 1064 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), base::Closure()); | 1069 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), |
| 1070 SurfaceFactory::DrawCallback()); |
| 1065 | 1071 |
| 1066 test::Quad root_quads[] = {test::Quad::SurfaceQuad(child_surface_id, 1.f)}; | 1072 test::Quad root_quads[] = {test::Quad::SurfaceQuad(child_surface_id, 1.f)}; |
| 1067 test::Pass root_passes[] = {test::Pass(root_quads, arraysize(root_quads))}; | 1073 test::Pass root_passes[] = {test::Pass(root_quads, arraysize(root_quads))}; |
| 1068 | 1074 |
| 1069 RenderPassList root_pass_list; | 1075 RenderPassList root_pass_list; |
| 1070 AddPasses(&root_pass_list, | 1076 AddPasses(&root_pass_list, |
| 1071 gfx::Rect(SurfaceSize()), | 1077 gfx::Rect(SurfaceSize()), |
| 1072 root_passes, | 1078 root_passes, |
| 1073 arraysize(root_passes)); | 1079 arraysize(root_passes)); |
| 1074 | 1080 |
| 1075 root_pass_list.at(0) | 1081 root_pass_list.at(0) |
| 1076 ->shared_quad_state_list.front() | 1082 ->shared_quad_state_list.front() |
| 1077 ->content_to_target_transform.Translate(0, 10); | 1083 ->content_to_target_transform.Translate(0, 10); |
| 1078 root_pass_list.at(0)->damage_rect = gfx::Rect(5, 5, 10, 10); | 1084 root_pass_list.at(0)->damage_rect = gfx::Rect(5, 5, 10, 10); |
| 1079 | 1085 |
| 1080 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1086 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1081 root_pass_list.swap(root_frame_data->render_pass_list); | 1087 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1082 | 1088 |
| 1083 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1089 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1084 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1090 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| 1085 | 1091 |
| 1086 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), base::Closure()); | 1092 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), |
| 1093 SurfaceFactory::DrawCallback()); |
| 1087 | 1094 |
| 1088 scoped_ptr<CompositorFrame> aggregated_frame = | 1095 scoped_ptr<CompositorFrame> aggregated_frame = |
| 1089 aggregator_.Aggregate(root_surface_id_); | 1096 aggregator_.Aggregate(root_surface_id_); |
| 1090 | 1097 |
| 1091 ASSERT_TRUE(aggregated_frame); | 1098 ASSERT_TRUE(aggregated_frame); |
| 1092 ASSERT_TRUE(aggregated_frame->delegated_frame_data); | 1099 ASSERT_TRUE(aggregated_frame->delegated_frame_data); |
| 1093 | 1100 |
| 1094 DelegatedFrameData* frame_data = aggregated_frame->delegated_frame_data.get(); | 1101 DelegatedFrameData* frame_data = aggregated_frame->delegated_frame_data.get(); |
| 1095 | 1102 |
| 1096 const RenderPassList& aggregated_pass_list = frame_data->render_pass_list; | 1103 const RenderPassList& aggregated_pass_list = frame_data->render_pass_list; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1112 child_root_pass->shared_quad_state_list.front(); | 1119 child_root_pass->shared_quad_state_list.front(); |
| 1113 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); | 1120 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); |
| 1114 child_root_pass->damage_rect = gfx::Rect(10, 10, 10, 10); | 1121 child_root_pass->damage_rect = gfx::Rect(10, 10, 10, 10); |
| 1115 | 1122 |
| 1116 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 1123 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 1117 child_pass_list.swap(child_frame_data->render_pass_list); | 1124 child_pass_list.swap(child_frame_data->render_pass_list); |
| 1118 | 1125 |
| 1119 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 1126 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 1120 child_frame->delegated_frame_data = child_frame_data.Pass(); | 1127 child_frame->delegated_frame_data = child_frame_data.Pass(); |
| 1121 | 1128 |
| 1122 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), base::Closure()); | 1129 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), |
| 1130 SurfaceFactory::DrawCallback()); |
| 1123 | 1131 |
| 1124 scoped_ptr<CompositorFrame> aggregated_frame = | 1132 scoped_ptr<CompositorFrame> aggregated_frame = |
| 1125 aggregator_.Aggregate(root_surface_id_); | 1133 aggregator_.Aggregate(root_surface_id_); |
| 1126 | 1134 |
| 1127 ASSERT_TRUE(aggregated_frame); | 1135 ASSERT_TRUE(aggregated_frame); |
| 1128 ASSERT_TRUE(aggregated_frame->delegated_frame_data); | 1136 ASSERT_TRUE(aggregated_frame->delegated_frame_data); |
| 1129 | 1137 |
| 1130 DelegatedFrameData* frame_data = | 1138 DelegatedFrameData* frame_data = |
| 1131 aggregated_frame->delegated_frame_data.get(); | 1139 aggregated_frame->delegated_frame_data.get(); |
| 1132 | 1140 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1151 ->shared_quad_state_list.front() | 1159 ->shared_quad_state_list.front() |
| 1152 ->content_to_target_transform.Translate(0, 10); | 1160 ->content_to_target_transform.Translate(0, 10); |
| 1153 root_pass_list.at(0)->damage_rect = gfx::Rect(0, 0, 1, 1); | 1161 root_pass_list.at(0)->damage_rect = gfx::Rect(0, 0, 1, 1); |
| 1154 | 1162 |
| 1155 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1163 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1156 root_pass_list.swap(root_frame_data->render_pass_list); | 1164 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1157 | 1165 |
| 1158 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1166 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1159 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1167 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| 1160 | 1168 |
| 1161 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), base::Closure()); | 1169 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), |
| 1170 SurfaceFactory::DrawCallback()); |
| 1162 } | 1171 } |
| 1163 | 1172 |
| 1164 { | 1173 { |
| 1165 RenderPassList root_pass_list; | 1174 RenderPassList root_pass_list; |
| 1166 AddPasses(&root_pass_list, | 1175 AddPasses(&root_pass_list, |
| 1167 gfx::Rect(SurfaceSize()), | 1176 gfx::Rect(SurfaceSize()), |
| 1168 root_passes, | 1177 root_passes, |
| 1169 arraysize(root_passes)); | 1178 arraysize(root_passes)); |
| 1170 | 1179 |
| 1171 root_pass_list.at(0) | 1180 root_pass_list.at(0) |
| 1172 ->shared_quad_state_list.front() | 1181 ->shared_quad_state_list.front() |
| 1173 ->content_to_target_transform.Translate(0, 10); | 1182 ->content_to_target_transform.Translate(0, 10); |
| 1174 root_pass_list.at(0)->damage_rect = gfx::Rect(1, 1, 1, 1); | 1183 root_pass_list.at(0)->damage_rect = gfx::Rect(1, 1, 1, 1); |
| 1175 | 1184 |
| 1176 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1185 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1177 root_pass_list.swap(root_frame_data->render_pass_list); | 1186 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1178 | 1187 |
| 1179 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1188 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1180 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1189 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| 1181 | 1190 |
| 1182 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), base::Closure()); | 1191 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), |
| 1192 SurfaceFactory::DrawCallback()); |
| 1183 | 1193 |
| 1184 scoped_ptr<CompositorFrame> aggregated_frame = | 1194 scoped_ptr<CompositorFrame> aggregated_frame = |
| 1185 aggregator_.Aggregate(root_surface_id_); | 1195 aggregator_.Aggregate(root_surface_id_); |
| 1186 | 1196 |
| 1187 ASSERT_TRUE(aggregated_frame); | 1197 ASSERT_TRUE(aggregated_frame); |
| 1188 ASSERT_TRUE(aggregated_frame->delegated_frame_data); | 1198 ASSERT_TRUE(aggregated_frame->delegated_frame_data); |
| 1189 | 1199 |
| 1190 DelegatedFrameData* frame_data = | 1200 DelegatedFrameData* frame_data = |
| 1191 aggregated_frame->delegated_frame_data.get(); | 1201 aggregated_frame->delegated_frame_data.get(); |
| 1192 | 1202 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 background_color, | 1298 background_color, |
| 1289 vertex_opacity, | 1299 vertex_opacity, |
| 1290 flipped, | 1300 flipped, |
| 1291 nearest_neighbor); | 1301 nearest_neighbor); |
| 1292 | 1302 |
| 1293 quad->shared_quad_state = sqs; | 1303 quad->shared_quad_state = sqs; |
| 1294 } | 1304 } |
| 1295 frame_data->render_pass_list.push_back(pass.Pass()); | 1305 frame_data->render_pass_list.push_back(pass.Pass()); |
| 1296 scoped_ptr<CompositorFrame> frame(new CompositorFrame); | 1306 scoped_ptr<CompositorFrame> frame(new CompositorFrame); |
| 1297 frame->delegated_frame_data = frame_data.Pass(); | 1307 frame->delegated_frame_data = frame_data.Pass(); |
| 1298 factory->SubmitFrame(surface_id, frame.Pass(), base::Closure()); | 1308 factory->SubmitFrame(surface_id, frame.Pass(), |
| 1309 SurfaceFactory::DrawCallback()); |
| 1299 } | 1310 } |
| 1300 | 1311 |
| 1301 TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) { | 1312 TEST_F(SurfaceAggregatorWithResourcesTest, TakeResourcesOneSurface) { |
| 1302 ResourceTrackingSurfaceFactoryClient client; | 1313 ResourceTrackingSurfaceFactoryClient client; |
| 1303 SurfaceFactory factory(&manager_, &client); | 1314 SurfaceFactory factory(&manager_, &client); |
| 1304 SurfaceId surface_id(7u); | 1315 SurfaceId surface_id(7u); |
| 1305 factory.Create(surface_id); | 1316 factory.Create(surface_id); |
| 1306 | 1317 |
| 1307 ResourceProvider::ResourceId ids[] = {11, 12, 13}; | 1318 ResourceProvider::ResourceId ids[] = {11, 12, 13}; |
| 1308 SubmitFrameWithResources(ids, arraysize(ids), &factory, surface_id); | 1319 SubmitFrameWithResources(ids, arraysize(ids), &factory, surface_id); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 EXPECT_THAT(returned_ids, | 1368 EXPECT_THAT(returned_ids, |
| 1358 testing::WhenSorted(testing::ElementsAreArray(ids))); | 1369 testing::WhenSorted(testing::ElementsAreArray(ids))); |
| 1359 EXPECT_EQ(3u, resource_provider_->num_resources()); | 1370 EXPECT_EQ(3u, resource_provider_->num_resources()); |
| 1360 factory.Destroy(surface_id); | 1371 factory.Destroy(surface_id); |
| 1361 factory.Destroy(surface_id2); | 1372 factory.Destroy(surface_id2); |
| 1362 } | 1373 } |
| 1363 | 1374 |
| 1364 } // namespace | 1375 } // namespace |
| 1365 } // namespace cc | 1376 } // namespace cc |
| 1366 | 1377 |
| OLD | NEW |