| 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 22 matching lines...) Expand all Loading... |
| 33 using cc::ResourceId; | 33 using cc::ResourceId; |
| 34 using cc::ResourceProvider; | 34 using cc::ResourceProvider; |
| 35 using cc::SharedQuadState; | 35 using cc::SharedQuadState; |
| 36 using cc::SolidColorDrawQuad; | 36 using cc::SolidColorDrawQuad; |
| 37 using cc::SurfaceDrawQuad; | 37 using cc::SurfaceDrawQuad; |
| 38 using cc::TextureDrawQuad; | 38 using cc::TextureDrawQuad; |
| 39 using cc::TileDrawQuad; | 39 using cc::TileDrawQuad; |
| 40 using cc::TransferableResource; | 40 using cc::TransferableResource; |
| 41 using cc::StreamVideoDrawQuad; | 41 using cc::StreamVideoDrawQuad; |
| 42 using cc::YUVVideoDrawQuad; | 42 using cc::YUVVideoDrawQuad; |
| 43 using cc::YVideoDrawQuad; |
| 43 using gfx::Transform; | 44 using gfx::Transform; |
| 44 | 45 |
| 45 namespace content { | 46 namespace content { |
| 46 namespace { | 47 namespace { |
| 47 | 48 |
| 48 static constexpr cc::FrameSinkId kArbitraryFrameSinkId(1, 1); | 49 static constexpr cc::FrameSinkId kArbitraryFrameSinkId(1, 1); |
| 49 | 50 |
| 50 class CCParamTraitsTest : public testing::Test { | 51 class CCParamTraitsTest : public testing::Test { |
| 51 protected: | 52 protected: |
| 52 void Compare(const RenderPass* a, const RenderPass* b) { | 53 void Compare(const RenderPass* a, const RenderPass* b) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 StreamVideoDrawQuad::MaterialCast(b)); | 108 StreamVideoDrawQuad::MaterialCast(b)); |
| 108 break; | 109 break; |
| 109 case DrawQuad::SURFACE_CONTENT: | 110 case DrawQuad::SURFACE_CONTENT: |
| 110 Compare(SurfaceDrawQuad::MaterialCast(a), | 111 Compare(SurfaceDrawQuad::MaterialCast(a), |
| 111 SurfaceDrawQuad::MaterialCast(b)); | 112 SurfaceDrawQuad::MaterialCast(b)); |
| 112 break; | 113 break; |
| 113 case DrawQuad::YUV_VIDEO_CONTENT: | 114 case DrawQuad::YUV_VIDEO_CONTENT: |
| 114 Compare(YUVVideoDrawQuad::MaterialCast(a), | 115 Compare(YUVVideoDrawQuad::MaterialCast(a), |
| 115 YUVVideoDrawQuad::MaterialCast(b)); | 116 YUVVideoDrawQuad::MaterialCast(b)); |
| 116 break; | 117 break; |
| 118 case DrawQuad::Y_VIDEO_CONTENT: |
| 119 Compare(YVideoDrawQuad::MaterialCast(a), |
| 120 YVideoDrawQuad::MaterialCast(b)); |
| 121 break; |
| 117 case DrawQuad::INVALID: | 122 case DrawQuad::INVALID: |
| 118 break; | 123 break; |
| 119 } | 124 } |
| 120 } | 125 } |
| 121 | 126 |
| 122 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { | 127 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { |
| 123 EXPECT_EQ(a->color, b->color); | 128 EXPECT_EQ(a->color, b->color); |
| 124 EXPECT_EQ(a->width, b->width); | 129 EXPECT_EQ(a->width, b->width); |
| 125 } | 130 } |
| 126 | 131 |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 EXPECT_TRUE( | 613 EXPECT_TRUE( |
| 609 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); | 614 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); |
| 610 | 615 |
| 611 ASSERT_EQ(2u, frame_out.resource_list.size()); | 616 ASSERT_EQ(2u, frame_out.resource_list.size()); |
| 612 Compare(arbitrary_resource1, frame_out.resource_list[0]); | 617 Compare(arbitrary_resource1, frame_out.resource_list[0]); |
| 613 Compare(arbitrary_resource2, frame_out.resource_list[1]); | 618 Compare(arbitrary_resource2, frame_out.resource_list[1]); |
| 614 } | 619 } |
| 615 | 620 |
| 616 } // namespace | 621 } // namespace |
| 617 } // namespace content | 622 } // namespace content |
| OLD | NEW |