| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "cc/input/selection.h" | 9 #include "cc/input/selection.h" |
| 10 #include "cc/ipc/copy_output_request_struct_traits.h" | 10 #include "cc/ipc/copy_output_request_struct_traits.h" |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 const gfx::Rect damage_rect(56, 123, 19, 43); | 822 const gfx::Rect damage_rect(56, 123, 19, 43); |
| 823 FilterOperations filters; | 823 FilterOperations filters; |
| 824 filters.Append(FilterOperation::CreateBlurFilter(0.f)); | 824 filters.Append(FilterOperation::CreateBlurFilter(0.f)); |
| 825 filters.Append(FilterOperation::CreateZoomFilter(2.0f, 1)); | 825 filters.Append(FilterOperation::CreateZoomFilter(2.0f, 1)); |
| 826 FilterOperations background_filters; | 826 FilterOperations background_filters; |
| 827 background_filters.Append(FilterOperation::CreateSaturateFilter(4.f)); | 827 background_filters.Append(FilterOperation::CreateSaturateFilter(4.f)); |
| 828 background_filters.Append(FilterOperation::CreateZoomFilter(2.0f, 1)); | 828 background_filters.Append(FilterOperation::CreateZoomFilter(2.0f, 1)); |
| 829 background_filters.Append(FilterOperation::CreateSaturateFilter(2.f)); | 829 background_filters.Append(FilterOperation::CreateSaturateFilter(2.f)); |
| 830 gfx::ColorSpace color_space = gfx::ColorSpace::CreateXYZD50(); | 830 gfx::ColorSpace color_space = gfx::ColorSpace::CreateXYZD50(); |
| 831 const bool has_transparent_background = true; | 831 const bool has_transparent_background = true; |
| 832 const bool cache_render_pass = false; |
| 833 const bool has_damage_from_contributing_content = false; |
| 832 std::unique_ptr<RenderPass> input = RenderPass::Create(); | 834 std::unique_ptr<RenderPass> input = RenderPass::Create(); |
| 833 input->SetAll(render_pass_id, output_rect, damage_rect, transform_to_root, | 835 input->SetAll(render_pass_id, output_rect, damage_rect, transform_to_root, |
| 834 filters, background_filters, color_space, | 836 filters, background_filters, color_space, |
| 835 has_transparent_background); | 837 has_transparent_background, cache_render_pass, |
| 838 has_damage_from_contributing_content); |
| 836 | 839 |
| 837 SharedQuadState* shared_state_1 = input->CreateAndAppendSharedQuadState(); | 840 SharedQuadState* shared_state_1 = input->CreateAndAppendSharedQuadState(); |
| 838 shared_state_1->SetAll( | 841 shared_state_1->SetAll( |
| 839 gfx::Transform(16.1f, 15.3f, 14.3f, 13.7f, 12.2f, 11.4f, 10.4f, 9.8f, | 842 gfx::Transform(16.1f, 15.3f, 14.3f, 13.7f, 12.2f, 11.4f, 10.4f, 9.8f, |
| 840 8.1f, 7.3f, 6.3f, 5.7f, 4.8f, 3.4f, 2.4f, 1.2f), | 843 8.1f, 7.3f, 6.3f, 5.7f, 4.8f, 3.4f, 2.4f, 1.2f), |
| 841 gfx::Rect(1, 2), gfx::Rect(1337, 5679, 9101112, 131415), | 844 gfx::Rect(1, 2), gfx::Rect(1337, 5679, 9101112, 131415), |
| 842 gfx::Rect(1357, 2468, 121314, 1337), true, 2, SkBlendMode::kSrcOver, 1); | 845 gfx::Rect(1357, 2468, 121314, 1337), true, 2, SkBlendMode::kSrcOver, 1); |
| 843 | 846 |
| 844 SharedQuadState* shared_state_2 = input->CreateAndAppendSharedQuadState(); | 847 SharedQuadState* shared_state_2 = input->CreateAndAppendSharedQuadState(); |
| 845 shared_state_2->SetAll( | 848 shared_state_2->SetAll( |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 TEST_F(StructTraitsTest, RenderPassWithEmptySharedQuadStateList) { | 943 TEST_F(StructTraitsTest, RenderPassWithEmptySharedQuadStateList) { |
| 941 const RenderPassId render_pass_id = 3u; | 944 const RenderPassId render_pass_id = 3u; |
| 942 const gfx::Rect output_rect(45, 22, 120, 13); | 945 const gfx::Rect output_rect(45, 22, 120, 13); |
| 943 const gfx::Transform transform_to_root = | 946 const gfx::Transform transform_to_root = |
| 944 gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0); | 947 gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0); |
| 945 const gfx::Rect damage_rect(56, 123, 19, 43); | 948 const gfx::Rect damage_rect(56, 123, 19, 43); |
| 946 SkMatrix44 to_XYZD50; | 949 SkMatrix44 to_XYZD50; |
| 947 SkColorSpaceTransferFn fn = {1, 0, 1, 0, 0, 0, 1}; | 950 SkColorSpaceTransferFn fn = {1, 0, 1, 0, 0, 0, 1}; |
| 948 gfx::ColorSpace color_space = gfx::ColorSpace::CreateCustom(to_XYZD50, fn); | 951 gfx::ColorSpace color_space = gfx::ColorSpace::CreateCustom(to_XYZD50, fn); |
| 949 const bool has_transparent_background = true; | 952 const bool has_transparent_background = true; |
| 953 const bool cache_render_pass = false; |
| 954 const bool has_damage_from_contributing_content = false; |
| 950 std::unique_ptr<RenderPass> input = RenderPass::Create(); | 955 std::unique_ptr<RenderPass> input = RenderPass::Create(); |
| 951 input->SetAll(render_pass_id, output_rect, damage_rect, transform_to_root, | 956 input->SetAll(render_pass_id, output_rect, damage_rect, transform_to_root, |
| 952 FilterOperations(), FilterOperations(), color_space, | 957 FilterOperations(), FilterOperations(), color_space, |
| 953 has_transparent_background); | 958 has_transparent_background, cache_render_pass, |
| 959 has_damage_from_contributing_content); |
| 954 | 960 |
| 955 // Unlike the previous test, don't add any quads to the list; we need to | 961 // Unlike the previous test, don't add any quads to the list; we need to |
| 956 // verify that the serialization code can deal with that. | 962 // verify that the serialization code can deal with that. |
| 957 std::unique_ptr<RenderPass> output; | 963 std::unique_ptr<RenderPass> output; |
| 958 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); | 964 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
| 959 proxy->EchoRenderPass(input->DeepCopy(), &output); | 965 proxy->EchoRenderPass(input->DeepCopy(), &output); |
| 960 | 966 |
| 961 EXPECT_EQ(input->quad_list.size(), output->quad_list.size()); | 967 EXPECT_EQ(input->quad_list.size(), output->quad_list.size()); |
| 962 EXPECT_EQ(input->shared_quad_state_list.size(), | 968 EXPECT_EQ(input->shared_quad_state_list.size(), |
| 963 output->shared_quad_state_list.size()); | 969 output->shared_quad_state_list.size()); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id()); | 1232 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id()); |
| 1227 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id()); | 1233 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id()); |
| 1228 EXPECT_EQ(color_space, out_quad->color_space); | 1234 EXPECT_EQ(color_space, out_quad->color_space); |
| 1229 EXPECT_EQ(resource_offset, out_quad->resource_offset); | 1235 EXPECT_EQ(resource_offset, out_quad->resource_offset); |
| 1230 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier); | 1236 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier); |
| 1231 EXPECT_EQ(bits_per_channel, out_quad->bits_per_channel); | 1237 EXPECT_EQ(bits_per_channel, out_quad->bits_per_channel); |
| 1232 EXPECT_EQ(require_overlay, out_quad->require_overlay); | 1238 EXPECT_EQ(require_overlay, out_quad->require_overlay); |
| 1233 } | 1239 } |
| 1234 | 1240 |
| 1235 } // namespace cc | 1241 } // namespace cc |
| OLD | NEW |