| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
| 7 #include "cc/output/gl_renderer.h" | 7 #include "cc/output/gl_renderer.h" |
| 8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
| 9 #include "cc/quads/picture_draw_quad.h" | 9 #include "cc/quads/picture_draw_quad.h" |
| 10 #include "cc/quads/texture_draw_quad.h" | 10 #include "cc/quads/texture_draw_quad.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); | 92 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); |
| 93 quad->SetNew(shared_state, | 93 quad->SetNew(shared_state, |
| 94 rect, | 94 rect, |
| 95 rect, | 95 rect, |
| 96 pass_id, | 96 pass_id, |
| 97 false, // is_replica | 97 false, // is_replica |
| 98 0, // mask_resource_id | 98 0, // mask_resource_id |
| 99 rect, // contents_changed_since_last_frame | 99 rect, // contents_changed_since_last_frame |
| 100 gfx::RectF(1.f, 1.f), // mask_uv_rect | 100 gfx::RectF(1.f, 1.f), // mask_uv_rect |
| 101 FilterOperations(), // foreground filters | 101 FilterOperations(), // foreground filters |
| 102 gfx::Vector2dF(), // filters scale |
| 102 FilterOperations()); // background filters | 103 FilterOperations()); // background filters |
| 103 | 104 |
| 104 return quad.PassAs<DrawQuad>(); | 105 return quad.PassAs<DrawQuad>(); |
| 105 } | 106 } |
| 106 | 107 |
| 107 scoped_ptr<TextureDrawQuad> CreateTestTextureDrawQuad( | 108 scoped_ptr<TextureDrawQuad> CreateTestTextureDrawQuad( |
| 108 const gfx::Rect& rect, | 109 const gfx::Rect& rect, |
| 109 SkColor texel_color, | 110 SkColor texel_color, |
| 110 SkColor background_color, | 111 SkColor background_color, |
| 111 bool premultiplied_alpha, | 112 bool premultiplied_alpha, |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 RenderPassDrawQuad::Create(); | 633 RenderPassDrawQuad::Create(); |
| 633 render_pass_quad->SetNew(pass_shared_state.get(), | 634 render_pass_quad->SetNew(pass_shared_state.get(), |
| 634 pass_rect, | 635 pass_rect, |
| 635 pass_rect, | 636 pass_rect, |
| 636 child_pass_id, | 637 child_pass_id, |
| 637 false, | 638 false, |
| 638 0, | 639 0, |
| 639 pass_rect, | 640 pass_rect, |
| 640 gfx::RectF(), | 641 gfx::RectF(), |
| 641 filters, | 642 filters, |
| 643 gfx::Vector2dF(), |
| 642 FilterOperations()); | 644 FilterOperations()); |
| 643 | 645 |
| 644 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); | 646 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); |
| 645 | 647 |
| 646 RenderPassList pass_list; | 648 RenderPassList pass_list; |
| 647 pass_list.push_back(child_pass.Pass()); | 649 pass_list.push_back(child_pass.Pass()); |
| 648 pass_list.push_back(root_pass.Pass()); | 650 pass_list.push_back(root_pass.Pass()); |
| 649 | 651 |
| 650 // This test has alpha=254 for the software renderer vs. alpha=255 for the gl | 652 // This test has alpha=254 for the software renderer vs. alpha=255 for the gl |
| 651 // renderer so use a fuzzy comparator. | 653 // renderer so use a fuzzy comparator. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 RenderPassDrawQuad::Create(); | 711 RenderPassDrawQuad::Create(); |
| 710 render_pass_quad->SetNew(pass_shared_state.get(), | 712 render_pass_quad->SetNew(pass_shared_state.get(), |
| 711 pass_rect, | 713 pass_rect, |
| 712 pass_rect, | 714 pass_rect, |
| 713 child_pass_id, | 715 child_pass_id, |
| 714 false, | 716 false, |
| 715 0, | 717 0, |
| 716 pass_rect, | 718 pass_rect, |
| 717 gfx::RectF(), | 719 gfx::RectF(), |
| 718 filters, | 720 filters, |
| 721 gfx::Vector2dF(), |
| 719 FilterOperations()); | 722 FilterOperations()); |
| 720 | 723 |
| 721 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); | 724 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); |
| 722 | 725 |
| 723 RenderPassList pass_list; | 726 RenderPassList pass_list; |
| 724 pass_list.push_back(child_pass.Pass()); | 727 pass_list.push_back(child_pass.Pass()); |
| 725 pass_list.push_back(root_pass.Pass()); | 728 pass_list.push_back(root_pass.Pass()); |
| 726 | 729 |
| 727 EXPECT_TRUE(this->RunPixelTest( | 730 EXPECT_TRUE(this->RunPixelTest( |
| 728 &pass_list, | 731 &pass_list, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 RenderPassDrawQuad::Create(); | 788 RenderPassDrawQuad::Create(); |
| 786 render_pass_quad->SetNew(pass_shared_state.get(), | 789 render_pass_quad->SetNew(pass_shared_state.get(), |
| 787 pass_rect, | 790 pass_rect, |
| 788 pass_rect, | 791 pass_rect, |
| 789 child_pass_id, | 792 child_pass_id, |
| 790 false, | 793 false, |
| 791 0, | 794 0, |
| 792 pass_rect, | 795 pass_rect, |
| 793 gfx::RectF(), | 796 gfx::RectF(), |
| 794 filters, | 797 filters, |
| 798 gfx::Vector2dF(), |
| 795 FilterOperations()); | 799 FilterOperations()); |
| 796 | 800 |
| 797 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); | 801 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); |
| 798 | 802 |
| 799 RenderPassList pass_list; | 803 RenderPassList pass_list; |
| 800 pass_list.push_back(child_pass.Pass()); | 804 pass_list.push_back(child_pass.Pass()); |
| 801 pass_list.push_back(root_pass.Pass()); | 805 pass_list.push_back(root_pass.Pass()); |
| 802 | 806 |
| 803 EXPECT_TRUE(this->RunPixelTest( | 807 EXPECT_TRUE(this->RunPixelTest( |
| 804 &pass_list, | 808 &pass_list, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 RenderPassDrawQuad::Create(); | 887 RenderPassDrawQuad::Create(); |
| 884 render_pass_quad->SetNew(pass_shared_state.get(), | 888 render_pass_quad->SetNew(pass_shared_state.get(), |
| 885 pass_rect, | 889 pass_rect, |
| 886 pass_rect, | 890 pass_rect, |
| 887 child_pass_id, | 891 child_pass_id, |
| 888 false, | 892 false, |
| 889 0, | 893 0, |
| 890 pass_rect, | 894 pass_rect, |
| 891 gfx::RectF(), | 895 gfx::RectF(), |
| 892 filters, | 896 filters, |
| 897 gfx::Vector2dF(), |
| 893 FilterOperations()); | 898 FilterOperations()); |
| 894 | 899 |
| 895 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); | 900 root_pass->quad_list.push_back(render_pass_quad.PassAs<DrawQuad>()); |
| 896 RenderPassList pass_list; | 901 RenderPassList pass_list; |
| 897 | 902 |
| 898 pass_list.push_back(child_pass.Pass()); | 903 pass_list.push_back(child_pass.Pass()); |
| 899 pass_list.push_back(root_pass.Pass()); | 904 pass_list.push_back(root_pass.Pass()); |
| 900 | 905 |
| 901 // This test has alpha=254 for the software renderer vs. alpha=255 for the gl | 906 // This test has alpha=254 for the software renderer vs. alpha=255 for the gl |
| 902 // renderer so use a fuzzy comparator. | 907 // renderer so use a fuzzy comparator. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1105 scoped_ptr<RenderPassDrawQuad> mask_quad = RenderPassDrawQuad::Create(); | 1110 scoped_ptr<RenderPassDrawQuad> mask_quad = RenderPassDrawQuad::Create(); |
| 1106 mask_quad->SetNew(root_pass_shared_state.get(), | 1111 mask_quad->SetNew(root_pass_shared_state.get(), |
| 1107 sub_rect, | 1112 sub_rect, |
| 1108 sub_rect, | 1113 sub_rect, |
| 1109 child_pass_id, | 1114 child_pass_id, |
| 1110 false, // is_replica | 1115 false, // is_replica |
| 1111 mask_resource_id, | 1116 mask_resource_id, |
| 1112 sub_rect, // contents_changed_since_last_frame | 1117 sub_rect, // contents_changed_since_last_frame |
| 1113 gfx::RectF(1.f, 1.f), // mask_uv_rect | 1118 gfx::RectF(1.f, 1.f), // mask_uv_rect |
| 1114 FilterOperations(), // foreground filters | 1119 FilterOperations(), // foreground filters |
| 1120 gfx::Vector2dF(), // filters scale |
| 1115 FilterOperations()); // background filters | 1121 FilterOperations()); // background filters |
| 1116 root_pass->quad_list.push_back(mask_quad.PassAs<DrawQuad>()); | 1122 root_pass->quad_list.push_back(mask_quad.PassAs<DrawQuad>()); |
| 1117 | 1123 |
| 1118 // White background behind the masked render pass. | 1124 // White background behind the masked render pass. |
| 1119 scoped_ptr<SolidColorDrawQuad> white = SolidColorDrawQuad::Create(); | 1125 scoped_ptr<SolidColorDrawQuad> white = SolidColorDrawQuad::Create(); |
| 1120 white->SetNew(root_pass_shared_state.get(), | 1126 white->SetNew(root_pass_shared_state.get(), |
| 1121 viewport_rect, | 1127 viewport_rect, |
| 1122 viewport_rect, | 1128 viewport_rect, |
| 1123 SK_ColorWHITE, | 1129 SK_ColorWHITE, |
| 1124 false); | 1130 false); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 filter_pass_quad->SetNew( | 1186 filter_pass_quad->SetNew( |
| 1181 shared_state.get(), | 1187 shared_state.get(), |
| 1182 filter_pass_content_rect_, | 1188 filter_pass_content_rect_, |
| 1183 filter_pass_content_rect_, | 1189 filter_pass_content_rect_, |
| 1184 filter_pass_id, | 1190 filter_pass_id, |
| 1185 false, // is_replica | 1191 false, // is_replica |
| 1186 0, // mask_resource_id | 1192 0, // mask_resource_id |
| 1187 filter_pass_content_rect_, // contents_changed_since_last_frame | 1193 filter_pass_content_rect_, // contents_changed_since_last_frame |
| 1188 gfx::RectF(), // mask_uv_rect | 1194 gfx::RectF(), // mask_uv_rect |
| 1189 FilterOperations(), // filters | 1195 FilterOperations(), // filters |
| 1196 gfx::Vector2dF(), // filters_scale |
| 1190 this->background_filters_); | 1197 this->background_filters_); |
| 1191 root_pass->quad_list.push_back(filter_pass_quad.PassAs<DrawQuad>()); | 1198 root_pass->quad_list.push_back(filter_pass_quad.PassAs<DrawQuad>()); |
| 1192 root_pass->shared_quad_state_list.push_back(shared_state.Pass()); | 1199 root_pass->shared_quad_state_list.push_back(shared_state.Pass()); |
| 1193 } | 1200 } |
| 1194 | 1201 |
| 1195 const int kColumnWidth = device_viewport_rect.width() / 3; | 1202 const int kColumnWidth = device_viewport_rect.width() / 3; |
| 1196 | 1203 |
| 1197 gfx::Rect left_rect = gfx::Rect(0, 0, kColumnWidth, 20); | 1204 gfx::Rect left_rect = gfx::Rect(0, 0, kColumnWidth, 20); |
| 1198 for (int i = 0; left_rect.y() < device_viewport_rect.height(); ++i) { | 1205 for (int i = 0; left_rect.y() < device_viewport_rect.height(); ++i) { |
| 1199 scoped_ptr<SharedQuadState> shared_state = | 1206 scoped_ptr<SharedQuadState> shared_state = |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2069 &pass_list, | 2076 &pass_list, |
| 2070 PixelTest::NoOffscreenContext, | 2077 PixelTest::NoOffscreenContext, |
| 2071 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")), | 2078 base::FilePath(FILE_PATH_LITERAL("wrap_mode_repeat.png")), |
| 2072 FuzzyPixelOffByOneComparator(true))); | 2079 FuzzyPixelOffByOneComparator(true))); |
| 2073 } | 2080 } |
| 2074 | 2081 |
| 2075 #endif // !defined(OS_ANDROID) | 2082 #endif // !defined(OS_ANDROID) |
| 2076 | 2083 |
| 2077 } // namespace | 2084 } // namespace |
| 2078 } // namespace cc | 2085 } // namespace cc |
| OLD | NEW |