| 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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 ASSERT_EQ(render_pass_quads[1]->material, DrawQuad::RENDER_PASS); | 683 ASSERT_EQ(render_pass_quads[1]->material, DrawQuad::RENDER_PASS); |
| 684 EXPECT_EQ( | 684 EXPECT_EQ( |
| 685 actual_pass_ids[1], | 685 actual_pass_ids[1], |
| 686 RenderPassDrawQuad::MaterialCast(render_pass_quads[1])->render_pass_id); | 686 RenderPassDrawQuad::MaterialCast(render_pass_quads[1])->render_pass_id); |
| 687 factory_.Destroy(child_surface_id); | 687 factory_.Destroy(child_surface_id); |
| 688 } | 688 } |
| 689 | 689 |
| 690 void AddSolidColorQuadWithBlendMode(const gfx::Size& size, | 690 void AddSolidColorQuadWithBlendMode(const gfx::Size& size, |
| 691 RenderPass* pass, | 691 RenderPass* pass, |
| 692 const SkXfermode::Mode blend_mode) { | 692 const SkXfermode::Mode blend_mode) { |
| 693 const gfx::Transform content_to_target_transform; | 693 const gfx::Transform layer_to_target_transform; |
| 694 const gfx::Size content_bounds(size); | 694 const gfx::Size layer_bounds(size); |
| 695 const gfx::Rect visible_content_rect(size); | 695 const gfx::Rect visible_layer_rect(size); |
| 696 const gfx::Rect clip_rect(size); | 696 const gfx::Rect clip_rect(size); |
| 697 | 697 |
| 698 bool is_clipped = false; | 698 bool is_clipped = false; |
| 699 float opacity = 1.f; | 699 float opacity = 1.f; |
| 700 | 700 |
| 701 bool force_anti_aliasing_off = false; | 701 bool force_anti_aliasing_off = false; |
| 702 SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); | 702 SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState(); |
| 703 sqs->SetAll(content_to_target_transform, | 703 sqs->SetAll(layer_to_target_transform, layer_bounds, visible_layer_rect, |
| 704 content_bounds, | 704 clip_rect, is_clipped, opacity, blend_mode, 0); |
| 705 visible_content_rect, | |
| 706 clip_rect, | |
| 707 is_clipped, | |
| 708 opacity, | |
| 709 blend_mode, | |
| 710 0); | |
| 711 | 705 |
| 712 SolidColorDrawQuad* color_quad = | 706 SolidColorDrawQuad* color_quad = |
| 713 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 707 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 714 color_quad->SetNew(pass->shared_quad_state_list.back(), | 708 color_quad->SetNew(pass->shared_quad_state_list.back(), visible_layer_rect, |
| 715 visible_content_rect, | 709 visible_layer_rect, SK_ColorGREEN, |
| 716 visible_content_rect, | |
| 717 SK_ColorGREEN, | |
| 718 force_anti_aliasing_off); | 710 force_anti_aliasing_off); |
| 719 } | 711 } |
| 720 | 712 |
| 721 // This tests that we update shared quad state pointers correctly within | 713 // This tests that we update shared quad state pointers correctly within |
| 722 // aggregated passes. The shared quad state list on the aggregated pass will | 714 // aggregated passes. The shared quad state list on the aggregated pass will |
| 723 // include the shared quad states from each pass in one list so the quads will | 715 // include the shared quad states from each pass in one list so the quads will |
| 724 // end up pointed to shared quad state objects at different offsets. This test | 716 // end up pointed to shared quad state objects at different offsets. This test |
| 725 // uses the blend_mode value stored on the shared quad state to track the shared | 717 // uses the blend_mode value stored on the shared quad state to track the shared |
| 726 // quad state, but anything saved on the shared quad state would work. | 718 // quad state, but anything saved on the shared quad state would work. |
| 727 // | 719 // |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 child_pass_id[1])}; | 874 child_pass_id[1])}; |
| 883 | 875 |
| 884 RenderPassList child_pass_list; | 876 RenderPassList child_pass_list; |
| 885 AddPasses(&child_pass_list, gfx::Rect(SurfaceSize()), child_passes, | 877 AddPasses(&child_pass_list, gfx::Rect(SurfaceSize()), child_passes, |
| 886 arraysize(child_passes)); | 878 arraysize(child_passes)); |
| 887 | 879 |
| 888 RenderPass* child_nonroot_pass = child_pass_list.at(0u); | 880 RenderPass* child_nonroot_pass = child_pass_list.at(0u); |
| 889 child_nonroot_pass->transform_to_root_target.Translate(8, 0); | 881 child_nonroot_pass->transform_to_root_target.Translate(8, 0); |
| 890 SharedQuadState* child_nonroot_pass_sqs = | 882 SharedQuadState* child_nonroot_pass_sqs = |
| 891 child_nonroot_pass->shared_quad_state_list.front(); | 883 child_nonroot_pass->shared_quad_state_list.front(); |
| 892 child_nonroot_pass_sqs->content_to_target_transform.Translate(5, 0); | 884 child_nonroot_pass_sqs->quad_to_target_transform.Translate(5, 0); |
| 893 | 885 |
| 894 RenderPass* child_root_pass = child_pass_list.at(1u); | 886 RenderPass* child_root_pass = child_pass_list.at(1u); |
| 895 SharedQuadState* child_root_pass_sqs = | 887 SharedQuadState* child_root_pass_sqs = |
| 896 child_root_pass->shared_quad_state_list.front(); | 888 child_root_pass->shared_quad_state_list.front(); |
| 897 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); | 889 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); |
| 898 child_root_pass_sqs->is_clipped = true; | 890 child_root_pass_sqs->is_clipped = true; |
| 899 child_root_pass_sqs->clip_rect = gfx::Rect(0, 0, 5, 5); | 891 child_root_pass_sqs->clip_rect = gfx::Rect(0, 0, 5, 5); |
| 900 | 892 |
| 901 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 893 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 902 child_pass_list.swap(child_frame_data->render_pass_list); | 894 child_pass_list.swap(child_frame_data->render_pass_list); |
| 903 | 895 |
| 904 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 896 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 905 child_frame->delegated_frame_data = child_frame_data.Pass(); | 897 child_frame->delegated_frame_data = child_frame_data.Pass(); |
| 906 | 898 |
| 907 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), | 899 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), |
| (...skipping 12 matching lines...) Expand all Loading... |
| 920 | 912 |
| 921 RenderPassList middle_pass_list; | 913 RenderPassList middle_pass_list; |
| 922 AddPasses(&middle_pass_list, gfx::Rect(SurfaceSize()), middle_passes, | 914 AddPasses(&middle_pass_list, gfx::Rect(SurfaceSize()), middle_passes, |
| 923 arraysize(middle_passes)); | 915 arraysize(middle_passes)); |
| 924 | 916 |
| 925 RenderPass* middle_root_pass = middle_pass_list.at(0u); | 917 RenderPass* middle_root_pass = middle_pass_list.at(0u); |
| 926 middle_root_pass->quad_list.ElementAt(0)->visible_rect = | 918 middle_root_pass->quad_list.ElementAt(0)->visible_rect = |
| 927 gfx::Rect(0, 1, 100, 7); | 919 gfx::Rect(0, 1, 100, 7); |
| 928 SharedQuadState* middle_root_pass_sqs = | 920 SharedQuadState* middle_root_pass_sqs = |
| 929 middle_root_pass->shared_quad_state_list.front(); | 921 middle_root_pass->shared_quad_state_list.front(); |
| 930 middle_root_pass_sqs->content_to_target_transform.Scale(2, 3); | 922 middle_root_pass_sqs->quad_to_target_transform.Scale(2, 3); |
| 931 | 923 |
| 932 scoped_ptr<DelegatedFrameData> middle_frame_data(new DelegatedFrameData); | 924 scoped_ptr<DelegatedFrameData> middle_frame_data(new DelegatedFrameData); |
| 933 middle_pass_list.swap(middle_frame_data->render_pass_list); | 925 middle_pass_list.swap(middle_frame_data->render_pass_list); |
| 934 | 926 |
| 935 scoped_ptr<CompositorFrame> middle_frame(new CompositorFrame); | 927 scoped_ptr<CompositorFrame> middle_frame(new CompositorFrame); |
| 936 middle_frame->delegated_frame_data = middle_frame_data.Pass(); | 928 middle_frame->delegated_frame_data = middle_frame_data.Pass(); |
| 937 | 929 |
| 938 factory_.SubmitFrame(middle_surface_id, middle_frame.Pass(), | 930 factory_.SubmitFrame(middle_surface_id, middle_frame.Pass(), |
| 939 SurfaceFactory::DrawCallback()); | 931 SurfaceFactory::DrawCallback()); |
| 940 } | 932 } |
| 941 | 933 |
| 942 // Root surface. | 934 // Root surface. |
| 943 test::Quad secondary_quads[] = { | 935 test::Quad secondary_quads[] = { |
| 944 test::Quad::SolidColorQuad(1), | 936 test::Quad::SolidColorQuad(1), |
| 945 test::Quad::SurfaceQuad(middle_surface_id, 1.f)}; | 937 test::Quad::SurfaceQuad(middle_surface_id, 1.f)}; |
| 946 test::Quad root_quads[] = {test::Quad::SolidColorQuad(1)}; | 938 test::Quad root_quads[] = {test::Quad::SolidColorQuad(1)}; |
| 947 test::Pass root_passes[] = { | 939 test::Pass root_passes[] = { |
| 948 test::Pass(secondary_quads, arraysize(secondary_quads)), | 940 test::Pass(secondary_quads, arraysize(secondary_quads)), |
| 949 test::Pass(root_quads, arraysize(root_quads))}; | 941 test::Pass(root_quads, arraysize(root_quads))}; |
| 950 | 942 |
| 951 RenderPassList root_pass_list; | 943 RenderPassList root_pass_list; |
| 952 AddPasses(&root_pass_list, | 944 AddPasses(&root_pass_list, |
| 953 gfx::Rect(SurfaceSize()), | 945 gfx::Rect(SurfaceSize()), |
| 954 root_passes, | 946 root_passes, |
| 955 arraysize(root_passes)); | 947 arraysize(root_passes)); |
| 956 | 948 |
| 957 root_pass_list.at(0) | 949 root_pass_list.at(0) |
| 958 ->shared_quad_state_list.front() | 950 ->shared_quad_state_list.front() |
| 959 ->content_to_target_transform.Translate(0, 7); | 951 ->quad_to_target_transform.Translate(0, 7); |
| 960 root_pass_list.at(0) | 952 root_pass_list.at(0) |
| 961 ->shared_quad_state_list.ElementAt(1) | 953 ->shared_quad_state_list.ElementAt(1) |
| 962 ->content_to_target_transform.Translate(0, 10); | 954 ->quad_to_target_transform.Translate(0, 10); |
| 963 root_pass_list.at(0)->quad_list.ElementAt(1)->visible_rect = | 955 root_pass_list.at(0)->quad_list.ElementAt(1)->visible_rect = |
| 964 gfx::Rect(0, 0, 8, 100); | 956 gfx::Rect(0, 0, 8, 100); |
| 965 | 957 |
| 966 root_pass_list[0]->transform_to_root_target.Translate(10, 5); | 958 root_pass_list[0]->transform_to_root_target.Translate(10, 5); |
| 967 | 959 |
| 968 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 960 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 969 root_pass_list.swap(root_frame_data->render_pass_list); | 961 root_pass_list.swap(root_frame_data->render_pass_list); |
| 970 | 962 |
| 971 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 963 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 972 root_frame->delegated_frame_data = root_frame_data.Pass(); | 964 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 998 EXPECT_EQ(1u, aggregated_pass_list[2]->shared_quad_state_list.size()); | 990 EXPECT_EQ(1u, aggregated_pass_list[2]->shared_quad_state_list.size()); |
| 999 | 991 |
| 1000 SharedQuadState* aggregated_first_pass_sqs = | 992 SharedQuadState* aggregated_first_pass_sqs = |
| 1001 aggregated_pass_list[0]->shared_quad_state_list.front(); | 993 aggregated_pass_list[0]->shared_quad_state_list.front(); |
| 1002 | 994 |
| 1003 // The first pass's transform should be unaffected by the embedding and still | 995 // The first pass's transform should be unaffected by the embedding and still |
| 1004 // be a translation by +5 in the x direction. | 996 // be a translation by +5 in the x direction. |
| 1005 gfx::Transform expected_aggregated_first_pass_sqs_transform; | 997 gfx::Transform expected_aggregated_first_pass_sqs_transform; |
| 1006 expected_aggregated_first_pass_sqs_transform.Translate(5, 0); | 998 expected_aggregated_first_pass_sqs_transform.Translate(5, 0); |
| 1007 EXPECT_EQ(expected_aggregated_first_pass_sqs_transform.ToString(), | 999 EXPECT_EQ(expected_aggregated_first_pass_sqs_transform.ToString(), |
| 1008 aggregated_first_pass_sqs->content_to_target_transform.ToString()); | 1000 aggregated_first_pass_sqs->quad_to_target_transform.ToString()); |
| 1009 | 1001 |
| 1010 // The first pass's transform to the root target should include the aggregated | 1002 // The first pass's transform to the root target should include the aggregated |
| 1011 // transform, including the transform from the child pass to the root. | 1003 // transform, including the transform from the child pass to the root. |
| 1012 gfx::Transform expected_first_pass_transform_to_root_target; | 1004 gfx::Transform expected_first_pass_transform_to_root_target; |
| 1013 expected_first_pass_transform_to_root_target.Translate(10, 5); | 1005 expected_first_pass_transform_to_root_target.Translate(10, 5); |
| 1014 expected_first_pass_transform_to_root_target.Translate(0, 10); | 1006 expected_first_pass_transform_to_root_target.Translate(0, 10); |
| 1015 expected_first_pass_transform_to_root_target.Scale(2, 3); | 1007 expected_first_pass_transform_to_root_target.Scale(2, 3); |
| 1016 expected_first_pass_transform_to_root_target.Translate(8, 0); | 1008 expected_first_pass_transform_to_root_target.Translate(8, 0); |
| 1017 EXPECT_EQ(expected_first_pass_transform_to_root_target.ToString(), | 1009 EXPECT_EQ(expected_first_pass_transform_to_root_target.ToString(), |
| 1018 aggregated_pass_list[0]->transform_to_root_target.ToString()); | 1010 aggregated_pass_list[0]->transform_to_root_target.ToString()); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1029 // (0, 10), the middle surface draw quad's scale of (2, 3), and the | 1021 // (0, 10), the middle surface draw quad's scale of (2, 3), and the |
| 1030 // child surface draw quad's translation (8, 0). | 1022 // child surface draw quad's translation (8, 0). |
| 1031 expected_root_pass_quad_transforms[1].Translate(0, 10); | 1023 expected_root_pass_quad_transforms[1].Translate(0, 10); |
| 1032 expected_root_pass_quad_transforms[1].Scale(2, 3); | 1024 expected_root_pass_quad_transforms[1].Scale(2, 3); |
| 1033 expected_root_pass_quad_transforms[1].Translate(8, 0); | 1025 expected_root_pass_quad_transforms[1].Translate(8, 0); |
| 1034 | 1026 |
| 1035 for (auto iter = aggregated_pass_list[1]->quad_list.cbegin(); | 1027 for (auto iter = aggregated_pass_list[1]->quad_list.cbegin(); |
| 1036 iter != aggregated_pass_list[1]->quad_list.cend(); | 1028 iter != aggregated_pass_list[1]->quad_list.cend(); |
| 1037 ++iter) { | 1029 ++iter) { |
| 1038 EXPECT_EQ(expected_root_pass_quad_transforms[iter.index()].ToString(), | 1030 EXPECT_EQ(expected_root_pass_quad_transforms[iter.index()].ToString(), |
| 1039 iter->shared_quad_state->content_to_target_transform.ToString()) | 1031 iter->shared_quad_state->quad_to_target_transform.ToString()) |
| 1040 << iter.index(); | 1032 << iter.index(); |
| 1041 } | 1033 } |
| 1042 | 1034 |
| 1043 EXPECT_TRUE( | 1035 EXPECT_TRUE( |
| 1044 aggregated_pass_list[1]->shared_quad_state_list.ElementAt(1)->is_clipped); | 1036 aggregated_pass_list[1]->shared_quad_state_list.ElementAt(1)->is_clipped); |
| 1045 | 1037 |
| 1046 // The second quad in the root pass is aggregated from the child, so its | 1038 // The second quad in the root pass is aggregated from the child, so its |
| 1047 // clip rect must be transformed by the child's translation/scale and | 1039 // clip rect must be transformed by the child's translation/scale and |
| 1048 // clipped be the visible_rects for both children. | 1040 // clipped be the visible_rects for both children. |
| 1049 EXPECT_EQ(gfx::Rect(0, 13, 8, 12).ToString(), | 1041 EXPECT_EQ(gfx::Rect(0, 13, 8, 12).ToString(), |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1066 | 1058 |
| 1067 RenderPassList child_pass_list; | 1059 RenderPassList child_pass_list; |
| 1068 AddPasses(&child_pass_list, | 1060 AddPasses(&child_pass_list, |
| 1069 gfx::Rect(SurfaceSize()), | 1061 gfx::Rect(SurfaceSize()), |
| 1070 child_passes, | 1062 child_passes, |
| 1071 arraysize(child_passes)); | 1063 arraysize(child_passes)); |
| 1072 | 1064 |
| 1073 RenderPass* child_root_pass = child_pass_list.at(0u); | 1065 RenderPass* child_root_pass = child_pass_list.at(0u); |
| 1074 SharedQuadState* child_root_pass_sqs = | 1066 SharedQuadState* child_root_pass_sqs = |
| 1075 child_root_pass->shared_quad_state_list.front(); | 1067 child_root_pass->shared_quad_state_list.front(); |
| 1076 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); | 1068 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); |
| 1077 | 1069 |
| 1078 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 1070 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 1079 child_pass_list.swap(child_frame_data->render_pass_list); | 1071 child_pass_list.swap(child_frame_data->render_pass_list); |
| 1080 | 1072 |
| 1081 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 1073 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 1082 child_frame->delegated_frame_data = child_frame_data.Pass(); | 1074 child_frame->delegated_frame_data = child_frame_data.Pass(); |
| 1083 | 1075 |
| 1084 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), | 1076 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), |
| 1085 SurfaceFactory::DrawCallback()); | 1077 SurfaceFactory::DrawCallback()); |
| 1086 | 1078 |
| 1087 RenderPassId pass_id(5, 10); | 1079 RenderPassId pass_id(5, 10); |
| 1088 test::Quad first_quads[] = {test::Quad::SurfaceQuad(child_surface_id, 1.f)}; | 1080 test::Quad first_quads[] = {test::Quad::SurfaceQuad(child_surface_id, 1.f)}; |
| 1089 test::Quad root_quads[] = {test::Quad::RenderPassQuad(pass_id)}; | 1081 test::Quad root_quads[] = {test::Quad::RenderPassQuad(pass_id)}; |
| 1090 | 1082 |
| 1091 test::Pass root_passes[] = { | 1083 test::Pass root_passes[] = { |
| 1092 test::Pass(first_quads, arraysize(first_quads), pass_id), | 1084 test::Pass(first_quads, arraysize(first_quads), pass_id), |
| 1093 test::Pass(root_quads, arraysize(root_quads))}; | 1085 test::Pass(root_quads, arraysize(root_quads))}; |
| 1094 | 1086 |
| 1095 RenderPassList root_pass_list; | 1087 RenderPassList root_pass_list; |
| 1096 AddPasses(&root_pass_list, | 1088 AddPasses(&root_pass_list, |
| 1097 gfx::Rect(SurfaceSize()), | 1089 gfx::Rect(SurfaceSize()), |
| 1098 root_passes, | 1090 root_passes, |
| 1099 arraysize(root_passes)); | 1091 arraysize(root_passes)); |
| 1100 | 1092 |
| 1101 root_pass_list.at(0) | 1093 root_pass_list.at(0) |
| 1102 ->shared_quad_state_list.front() | 1094 ->shared_quad_state_list.front() |
| 1103 ->content_to_target_transform.Translate(0, 10); | 1095 ->quad_to_target_transform.Translate(0, 10); |
| 1104 root_pass_list.at(0)->damage_rect = gfx::Rect(5, 5, 10, 10); | 1096 root_pass_list.at(0)->damage_rect = gfx::Rect(5, 5, 10, 10); |
| 1105 root_pass_list.at(1)->damage_rect = gfx::Rect(5, 5, 100, 100); | 1097 root_pass_list.at(1)->damage_rect = gfx::Rect(5, 5, 100, 100); |
| 1106 | 1098 |
| 1107 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1099 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1108 root_pass_list.swap(root_frame_data->render_pass_list); | 1100 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1109 | 1101 |
| 1110 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1102 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1111 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1103 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| 1112 | 1104 |
| 1113 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), | 1105 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1131 | 1123 |
| 1132 { | 1124 { |
| 1133 AddPasses(&child_pass_list, | 1125 AddPasses(&child_pass_list, |
| 1134 gfx::Rect(SurfaceSize()), | 1126 gfx::Rect(SurfaceSize()), |
| 1135 child_passes, | 1127 child_passes, |
| 1136 arraysize(child_passes)); | 1128 arraysize(child_passes)); |
| 1137 | 1129 |
| 1138 RenderPass* child_root_pass = child_pass_list.at(0u); | 1130 RenderPass* child_root_pass = child_pass_list.at(0u); |
| 1139 SharedQuadState* child_root_pass_sqs = | 1131 SharedQuadState* child_root_pass_sqs = |
| 1140 child_root_pass->shared_quad_state_list.front(); | 1132 child_root_pass->shared_quad_state_list.front(); |
| 1141 child_root_pass_sqs->content_to_target_transform.Translate(8, 0); | 1133 child_root_pass_sqs->quad_to_target_transform.Translate(8, 0); |
| 1142 child_root_pass->damage_rect = gfx::Rect(10, 10, 10, 10); | 1134 child_root_pass->damage_rect = gfx::Rect(10, 10, 10, 10); |
| 1143 | 1135 |
| 1144 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); | 1136 scoped_ptr<DelegatedFrameData> child_frame_data(new DelegatedFrameData); |
| 1145 child_pass_list.swap(child_frame_data->render_pass_list); | 1137 child_pass_list.swap(child_frame_data->render_pass_list); |
| 1146 | 1138 |
| 1147 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 1139 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
| 1148 child_frame->delegated_frame_data = child_frame_data.Pass(); | 1140 child_frame->delegated_frame_data = child_frame_data.Pass(); |
| 1149 | 1141 |
| 1150 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), | 1142 factory_.SubmitFrame(child_surface_id, child_frame.Pass(), |
| 1151 SurfaceFactory::DrawCallback()); | 1143 SurfaceFactory::DrawCallback()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1171 | 1163 |
| 1172 { | 1164 { |
| 1173 RenderPassList root_pass_list; | 1165 RenderPassList root_pass_list; |
| 1174 AddPasses(&root_pass_list, | 1166 AddPasses(&root_pass_list, |
| 1175 gfx::Rect(SurfaceSize()), | 1167 gfx::Rect(SurfaceSize()), |
| 1176 root_passes, | 1168 root_passes, |
| 1177 arraysize(root_passes)); | 1169 arraysize(root_passes)); |
| 1178 | 1170 |
| 1179 root_pass_list.at(0) | 1171 root_pass_list.at(0) |
| 1180 ->shared_quad_state_list.front() | 1172 ->shared_quad_state_list.front() |
| 1181 ->content_to_target_transform.Translate(0, 10); | 1173 ->quad_to_target_transform.Translate(0, 10); |
| 1182 root_pass_list.at(0)->damage_rect = gfx::Rect(0, 0, 1, 1); | 1174 root_pass_list.at(0)->damage_rect = gfx::Rect(0, 0, 1, 1); |
| 1183 | 1175 |
| 1184 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1176 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1185 root_pass_list.swap(root_frame_data->render_pass_list); | 1177 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1186 | 1178 |
| 1187 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1179 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1188 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1180 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| 1189 | 1181 |
| 1190 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), | 1182 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), |
| 1191 SurfaceFactory::DrawCallback()); | 1183 SurfaceFactory::DrawCallback()); |
| 1192 } | 1184 } |
| 1193 | 1185 |
| 1194 { | 1186 { |
| 1195 RenderPassList root_pass_list; | 1187 RenderPassList root_pass_list; |
| 1196 AddPasses(&root_pass_list, | 1188 AddPasses(&root_pass_list, |
| 1197 gfx::Rect(SurfaceSize()), | 1189 gfx::Rect(SurfaceSize()), |
| 1198 root_passes, | 1190 root_passes, |
| 1199 arraysize(root_passes)); | 1191 arraysize(root_passes)); |
| 1200 | 1192 |
| 1201 root_pass_list.at(0) | 1193 root_pass_list.at(0) |
| 1202 ->shared_quad_state_list.front() | 1194 ->shared_quad_state_list.front() |
| 1203 ->content_to_target_transform.Translate(0, 10); | 1195 ->quad_to_target_transform.Translate(0, 10); |
| 1204 root_pass_list.at(0)->damage_rect = gfx::Rect(1, 1, 1, 1); | 1196 root_pass_list.at(0)->damage_rect = gfx::Rect(1, 1, 1, 1); |
| 1205 | 1197 |
| 1206 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); | 1198 scoped_ptr<DelegatedFrameData> root_frame_data(new DelegatedFrameData); |
| 1207 root_pass_list.swap(root_frame_data->render_pass_list); | 1199 root_pass_list.swap(root_frame_data->render_pass_list); |
| 1208 | 1200 |
| 1209 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 1201 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
| 1210 root_frame->delegated_frame_data = root_frame_data.Pass(); | 1202 root_frame->delegated_frame_data = root_frame_data.Pass(); |
| 1211 | 1203 |
| 1212 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), | 1204 factory_.SubmitFrame(root_surface_id_, root_frame.Pass(), |
| 1213 SurfaceFactory::DrawCallback()); | 1205 SurfaceFactory::DrawCallback()); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1506 EXPECT_EQ(9u, pass_list->back()->quad_list.size()); | 1498 EXPECT_EQ(9u, pass_list->back()->quad_list.size()); |
| 1507 | 1499 |
| 1508 factory.Destroy(root_surface_id); | 1500 factory.Destroy(root_surface_id); |
| 1509 factory.Destroy(child_surface_id); | 1501 factory.Destroy(child_surface_id); |
| 1510 factory.Destroy(middle_surface_id); | 1502 factory.Destroy(middle_surface_id); |
| 1511 } | 1503 } |
| 1512 | 1504 |
| 1513 } // namespace | 1505 } // namespace |
| 1514 } // namespace cc | 1506 } // namespace cc |
| 1515 | 1507 |
| OLD | NEW |