Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: cc/ipc/struct_traits_unittest.cc

Issue 2828833002: color: Fix custom params IPC (Closed)
Patch Set: color: Fix custom params IPC Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/ipc/color/gfx_param_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "cc/input/selection.h" 7 #include "cc/input/selection.h"
8 #include "cc/ipc/copy_output_request_struct_traits.h" 8 #include "cc/ipc/copy_output_request_struct_traits.h"
9 #include "cc/ipc/traits_test_service.mojom.h" 9 #include "cc/ipc/traits_test_service.mojom.h"
10 #include "cc/output/copy_output_result.h" 10 #include "cc/output/copy_output_result.h"
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 EXPECT_EQ(surface_quad->visible_rect, out_surface_quad->visible_rect); 941 EXPECT_EQ(surface_quad->visible_rect, out_surface_quad->visible_rect);
942 EXPECT_EQ(surface_quad->surface_id, out_surface_quad->surface_id); 942 EXPECT_EQ(surface_quad->surface_id, out_surface_quad->surface_id);
943 } 943 }
944 944
945 TEST_F(StructTraitsTest, RenderPassWithEmptySharedQuadStateList) { 945 TEST_F(StructTraitsTest, RenderPassWithEmptySharedQuadStateList) {
946 const int id = 3; 946 const int id = 3;
947 const gfx::Rect output_rect(45, 22, 120, 13); 947 const gfx::Rect output_rect(45, 22, 120, 13);
948 const gfx::Transform transform_to_root = 948 const gfx::Transform transform_to_root =
949 gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0); 949 gfx::Transform(1.0, 0.5, 0.5, -0.5, -1.0, 0.0);
950 const gfx::Rect damage_rect(56, 123, 19, 43); 950 const gfx::Rect damage_rect(56, 123, 19, 43);
951 gfx::ColorSpace color_space = gfx::ColorSpace::CreateSCRGBLinear(); 951 SkMatrix44 to_XYZD50;
952 SkColorSpaceTransferFn fn = {1, 0, 1, 0, 0, 0, 1};
953 gfx::ColorSpace color_space = gfx::ColorSpace::CreateCustom(to_XYZD50, fn);
952 const bool has_transparent_background = true; 954 const bool has_transparent_background = true;
953 std::unique_ptr<RenderPass> input = RenderPass::Create(); 955 std::unique_ptr<RenderPass> input = RenderPass::Create();
954 input->SetAll(id, output_rect, damage_rect, transform_to_root, 956 input->SetAll(id, output_rect, damage_rect, transform_to_root,
955 FilterOperations(), FilterOperations(), color_space, 957 FilterOperations(), FilterOperations(), color_space,
956 has_transparent_background); 958 has_transparent_background);
957 959
958 // Unlike the previous test, don't add any quads to the list; we need to 960 // Unlike the previous test, don't add any quads to the list; we need to
959 // verify that the serialization code can deal with that. 961 // verify that the serialization code can deal with that.
960 std::unique_ptr<RenderPass> output; 962 std::unique_ptr<RenderPass> output;
961 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); 963 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
1239 EXPECT_EQ(u_plane_resource_id, out_quad->u_plane_resource_id()); 1241 EXPECT_EQ(u_plane_resource_id, out_quad->u_plane_resource_id());
1240 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id()); 1242 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id());
1241 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id()); 1243 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id());
1242 EXPECT_EQ(color_space, out_quad->color_space); 1244 EXPECT_EQ(color_space, out_quad->color_space);
1243 EXPECT_EQ(resource_offset, out_quad->resource_offset); 1245 EXPECT_EQ(resource_offset, out_quad->resource_offset);
1244 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier); 1246 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier);
1245 EXPECT_EQ(bits_per_channel, out_quad->bits_per_channel); 1247 EXPECT_EQ(bits_per_channel, out_quad->bits_per_channel);
1246 } 1248 }
1247 1249
1248 } // namespace cc 1250 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/ipc/color/gfx_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698