Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 void Compare(const YUVVideoDrawQuad* a, const YUVVideoDrawQuad* b) { | 198 void Compare(const YUVVideoDrawQuad* a, const YUVVideoDrawQuad* b) { |
| 199 EXPECT_EQ(a->ya_tex_coord_rect, b->ya_tex_coord_rect); | 199 EXPECT_EQ(a->ya_tex_coord_rect, b->ya_tex_coord_rect); |
| 200 EXPECT_EQ(a->uv_tex_coord_rect, b->uv_tex_coord_rect); | 200 EXPECT_EQ(a->uv_tex_coord_rect, b->uv_tex_coord_rect); |
| 201 EXPECT_EQ(a->ya_tex_size, b->ya_tex_size); | 201 EXPECT_EQ(a->ya_tex_size, b->ya_tex_size); |
| 202 EXPECT_EQ(a->uv_tex_size, b->uv_tex_size); | 202 EXPECT_EQ(a->uv_tex_size, b->uv_tex_size); |
| 203 EXPECT_EQ(a->y_plane_resource_id(), b->y_plane_resource_id()); | 203 EXPECT_EQ(a->y_plane_resource_id(), b->y_plane_resource_id()); |
| 204 EXPECT_EQ(a->u_plane_resource_id(), b->u_plane_resource_id()); | 204 EXPECT_EQ(a->u_plane_resource_id(), b->u_plane_resource_id()); |
| 205 EXPECT_EQ(a->v_plane_resource_id(), b->v_plane_resource_id()); | 205 EXPECT_EQ(a->v_plane_resource_id(), b->v_plane_resource_id()); |
| 206 EXPECT_EQ(a->a_plane_resource_id(), b->a_plane_resource_id()); | 206 EXPECT_EQ(a->a_plane_resource_id(), b->a_plane_resource_id()); |
| 207 EXPECT_EQ(a->color_space, b->color_space); | 207 EXPECT_EQ(a->color_space, b->color_space); |
| 208 EXPECT_EQ(a->bits_per_channel, b->bits_per_channel); | 208 EXPECT_EQ(a->bits_per_channel, b->bits_per_channel); |
|
danakj
2017/06/07 15:26:40
Compare it here?
| |
| 209 } | 209 } |
| 210 | 210 |
| 211 void Compare(const TransferableResource& a, const TransferableResource& b) { | 211 void Compare(const TransferableResource& a, const TransferableResource& b) { |
| 212 EXPECT_EQ(a.id, b.id); | 212 EXPECT_EQ(a.id, b.id); |
| 213 EXPECT_EQ(a.format, b.format); | 213 EXPECT_EQ(a.format, b.format); |
| 214 EXPECT_EQ(a.filter, b.filter); | 214 EXPECT_EQ(a.filter, b.filter); |
| 215 EXPECT_EQ(a.size.ToString(), b.size.ToString()); | 215 EXPECT_EQ(a.size.ToString(), b.size.ToString()); |
| 216 for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) { | 216 for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) { |
| 217 EXPECT_EQ(a.mailbox_holder.mailbox.name[i], | 217 EXPECT_EQ(a.mailbox_holder.mailbox.name[i], |
| 218 b.mailbox_holder.mailbox.name[i]); | 218 b.mailbox_holder.mailbox.name[i]); |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 pass_cmp->CopyFromAndAppendDrawQuad(tile_in, tile_in->shared_quad_state); | 413 pass_cmp->CopyFromAndAppendDrawQuad(tile_in, tile_in->shared_quad_state); |
| 414 | 414 |
| 415 YUVVideoDrawQuad* yuvvideo_in = | 415 YUVVideoDrawQuad* yuvvideo_in = |
| 416 pass_in->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | 416 pass_in->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
| 417 yuvvideo_in->SetAll( | 417 yuvvideo_in->SetAll( |
| 418 shared_state3_in, arbitrary_rect1, arbitrary_rect2_inside_rect1, | 418 shared_state3_in, arbitrary_rect1, arbitrary_rect2_inside_rect1, |
| 419 arbitrary_rect1_inside_rect1, arbitrary_bool1, arbitrary_rectf1, | 419 arbitrary_rect1_inside_rect1, arbitrary_bool1, arbitrary_rectf1, |
| 420 arbitrary_rectf2, arbitrary_size1, arbitrary_size2, arbitrary_resourceid1, | 420 arbitrary_rectf2, arbitrary_size1, arbitrary_size2, arbitrary_resourceid1, |
| 421 arbitrary_resourceid2, arbitrary_resourceid3, arbitrary_resourceid4, | 421 arbitrary_resourceid2, arbitrary_resourceid3, arbitrary_resourceid4, |
| 422 arbitrary_video_color_space, arbitrary_color_space, arbitrary_float1, | 422 arbitrary_video_color_space, arbitrary_color_space, arbitrary_float1, |
| 423 arbitrary_float2, arbitrary_int); | 423 arbitrary_float2, arbitrary_int, arbitrary_bool2); |
| 424 pass_cmp->CopyFromAndAppendDrawQuad(yuvvideo_in, | 424 pass_cmp->CopyFromAndAppendDrawQuad(yuvvideo_in, |
| 425 yuvvideo_in->shared_quad_state); | 425 yuvvideo_in->shared_quad_state); |
| 426 | 426 |
| 427 // Make sure the in and cmp RenderPasses match. | 427 // Make sure the in and cmp RenderPasses match. |
| 428 Compare(child_pass_cmp.get(), child_pass_in.get()); | 428 Compare(child_pass_cmp.get(), child_pass_in.get()); |
| 429 ASSERT_EQ(0u, child_pass_in->shared_quad_state_list.size()); | 429 ASSERT_EQ(0u, child_pass_in->shared_quad_state_list.size()); |
| 430 ASSERT_EQ(0u, child_pass_in->quad_list.size()); | 430 ASSERT_EQ(0u, child_pass_in->quad_list.size()); |
| 431 Compare(pass_cmp.get(), pass_in.get()); | 431 Compare(pass_cmp.get(), pass_in.get()); |
| 432 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size()); | 432 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size()); |
| 433 ASSERT_EQ(8u, pass_in->quad_list.size()); | 433 ASSERT_EQ(8u, pass_in->quad_list.size()); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 652 cc::SurfaceInfo surface_info_out; | 652 cc::SurfaceInfo surface_info_out; |
| 653 base::PickleIterator iter(msg); | 653 base::PickleIterator iter(msg); |
| 654 EXPECT_TRUE( | 654 EXPECT_TRUE( |
| 655 IPC::ParamTraits<cc::SurfaceInfo>::Read(&msg, &iter, &surface_info_out)); | 655 IPC::ParamTraits<cc::SurfaceInfo>::Read(&msg, &iter, &surface_info_out)); |
| 656 | 656 |
| 657 ASSERT_EQ(surface_info_in, surface_info_out); | 657 ASSERT_EQ(surface_info_in, surface_info_out); |
| 658 } | 658 } |
| 659 | 659 |
| 660 } // namespace | 660 } // namespace |
| 661 } // namespace content | 661 } // namespace content |
| OLD | NEW |