| 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 "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "cc/input/selection.h" | 6 #include "cc/input/selection.h" |
| 7 #include "cc/ipc/traits_test_service.mojom.h" | 7 #include "cc/ipc/traits_test_service.mojom.h" |
| 8 #include "cc/quads/debug_border_draw_quad.h" | 8 #include "cc/quads/debug_border_draw_quad.h" |
| 9 #include "cc/quads/render_pass.h" | 9 #include "cc/quads/render_pass.h" |
| 10 #include "cc/quads/render_pass_draw_quad.h" | 10 #include "cc/quads/render_pass_draw_quad.h" |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7, | 468 8, 7, 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7, |
| 469 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7}; | 469 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7}; |
| 470 const gpu::CommandBufferNamespace command_buffer_namespace = gpu::IN_PROCESS; | 470 const gpu::CommandBufferNamespace command_buffer_namespace = gpu::IN_PROCESS; |
| 471 const int32_t extra_data_field = 0xbeefbeef; | 471 const int32_t extra_data_field = 0xbeefbeef; |
| 472 const gpu::CommandBufferId command_buffer_id( | 472 const gpu::CommandBufferId command_buffer_id( |
| 473 gpu::CommandBufferId::FromUnsafeValue(0xdeadbeef)); | 473 gpu::CommandBufferId::FromUnsafeValue(0xdeadbeef)); |
| 474 const uint64_t release_count = 0xdeadbeefdeadL; | 474 const uint64_t release_count = 0xdeadbeefdeadL; |
| 475 const uint32_t texture_target = 1337; | 475 const uint32_t texture_target = 1337; |
| 476 const bool read_lock_fences_enabled = true; | 476 const bool read_lock_fences_enabled = true; |
| 477 const bool is_software = false; | 477 const bool is_software = false; |
| 478 const int gpu_memory_buffer_id = 0xdeadbeef; | |
| 479 const bool is_overlay_candidate = true; | 478 const bool is_overlay_candidate = true; |
| 480 | 479 |
| 481 gpu::MailboxHolder mailbox_holder; | 480 gpu::MailboxHolder mailbox_holder; |
| 482 mailbox_holder.mailbox.SetName(mailbox_name); | 481 mailbox_holder.mailbox.SetName(mailbox_name); |
| 483 mailbox_holder.sync_token = | 482 mailbox_holder.sync_token = |
| 484 gpu::SyncToken(command_buffer_namespace, extra_data_field, | 483 gpu::SyncToken(command_buffer_namespace, extra_data_field, |
| 485 command_buffer_id, release_count); | 484 command_buffer_id, release_count); |
| 486 mailbox_holder.texture_target = texture_target; | 485 mailbox_holder.texture_target = texture_target; |
| 487 TransferableResource input; | 486 TransferableResource input; |
| 488 input.id = id; | 487 input.id = id; |
| 489 input.format = format; | 488 input.format = format; |
| 490 input.filter = filter; | 489 input.filter = filter; |
| 491 input.size = size; | 490 input.size = size; |
| 492 input.mailbox_holder = mailbox_holder; | 491 input.mailbox_holder = mailbox_holder; |
| 493 input.read_lock_fences_enabled = read_lock_fences_enabled; | 492 input.read_lock_fences_enabled = read_lock_fences_enabled; |
| 494 input.is_software = is_software; | 493 input.is_software = is_software; |
| 495 input.gpu_memory_buffer_id.id = gpu_memory_buffer_id; | |
| 496 input.is_overlay_candidate = is_overlay_candidate; | 494 input.is_overlay_candidate = is_overlay_candidate; |
| 497 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); | 495 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy(); |
| 498 TransferableResource output; | 496 TransferableResource output; |
| 499 proxy->EchoTransferableResource(input, &output); | 497 proxy->EchoTransferableResource(input, &output); |
| 500 EXPECT_EQ(id, output.id); | 498 EXPECT_EQ(id, output.id); |
| 501 EXPECT_EQ(format, output.format); | 499 EXPECT_EQ(format, output.format); |
| 502 EXPECT_EQ(filter, output.filter); | 500 EXPECT_EQ(filter, output.filter); |
| 503 EXPECT_EQ(size, output.size); | 501 EXPECT_EQ(size, output.size); |
| 504 EXPECT_EQ(mailbox_holder.mailbox, output.mailbox_holder.mailbox); | 502 EXPECT_EQ(mailbox_holder.mailbox, output.mailbox_holder.mailbox); |
| 505 EXPECT_EQ(mailbox_holder.sync_token, output.mailbox_holder.sync_token); | 503 EXPECT_EQ(mailbox_holder.sync_token, output.mailbox_holder.sync_token); |
| 506 EXPECT_EQ(mailbox_holder.texture_target, | 504 EXPECT_EQ(mailbox_holder.texture_target, |
| 507 output.mailbox_holder.texture_target); | 505 output.mailbox_holder.texture_target); |
| 508 EXPECT_EQ(read_lock_fences_enabled, output.read_lock_fences_enabled); | 506 EXPECT_EQ(read_lock_fences_enabled, output.read_lock_fences_enabled); |
| 509 EXPECT_EQ(is_software, output.is_software); | 507 EXPECT_EQ(is_software, output.is_software); |
| 510 EXPECT_EQ(gpu_memory_buffer_id, output.gpu_memory_buffer_id.id); | |
| 511 EXPECT_EQ(is_overlay_candidate, output.is_overlay_candidate); | 508 EXPECT_EQ(is_overlay_candidate, output.is_overlay_candidate); |
| 512 } | 509 } |
| 513 | 510 |
| 514 TEST_F(StructTraitsTest, YUVDrawQuad) { | 511 TEST_F(StructTraitsTest, YUVDrawQuad) { |
| 515 const DrawQuad::Material material = DrawQuad::YUV_VIDEO_CONTENT; | 512 const DrawQuad::Material material = DrawQuad::YUV_VIDEO_CONTENT; |
| 516 const gfx::Rect rect(1234, 4321, 1357, 7531); | 513 const gfx::Rect rect(1234, 4321, 1357, 7531); |
| 517 const gfx::Rect opaque_rect(1357, 8642, 432, 123); | 514 const gfx::Rect opaque_rect(1357, 8642, 432, 123); |
| 518 const gfx::Rect visible_rect(1337, 7331, 561, 293); | 515 const gfx::Rect visible_rect(1337, 7331, 561, 293); |
| 519 const bool needs_blending = true; | 516 const bool needs_blending = true; |
| 520 const gfx::RectF ya_tex_coord_rect(1234.1f, 5678.2f, 9101112.3f, 13141516.4f); | 517 const gfx::RectF ya_tex_coord_rect(1234.1f, 5678.2f, 9101112.3f, 13141516.4f); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 EXPECT_EQ(y_plane_resource_id, out_quad->y_plane_resource_id()); | 555 EXPECT_EQ(y_plane_resource_id, out_quad->y_plane_resource_id()); |
| 559 EXPECT_EQ(u_plane_resource_id, out_quad->u_plane_resource_id()); | 556 EXPECT_EQ(u_plane_resource_id, out_quad->u_plane_resource_id()); |
| 560 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id()); | 557 EXPECT_EQ(v_plane_resource_id, out_quad->v_plane_resource_id()); |
| 561 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id()); | 558 EXPECT_EQ(a_plane_resource_id, out_quad->a_plane_resource_id()); |
| 562 EXPECT_EQ(color_space, out_quad->color_space); | 559 EXPECT_EQ(color_space, out_quad->color_space); |
| 563 EXPECT_EQ(resource_offset, out_quad->resource_offset); | 560 EXPECT_EQ(resource_offset, out_quad->resource_offset); |
| 564 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier); | 561 EXPECT_EQ(resource_multiplier, out_quad->resource_multiplier); |
| 565 } | 562 } |
| 566 | 563 |
| 567 } // namespace cc | 564 } // namespace cc |
| OLD | NEW |