| 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 class CCParamTraitsTest : public testing::Test { | 49 class CCParamTraitsTest : public testing::Test { |
| 49 protected: | 50 protected: |
| 50 void Compare(const RenderPass* a, const RenderPass* b) { | 51 void Compare(const RenderPass* a, const RenderPass* b) { |
| 51 EXPECT_EQ(a->id, b->id); | 52 EXPECT_EQ(a->id, b->id); |
| 52 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); | 53 EXPECT_EQ(a->output_rect.ToString(), b->output_rect.ToString()); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 StreamVideoDrawQuad::MaterialCast(b)); | 106 StreamVideoDrawQuad::MaterialCast(b)); |
| 106 break; | 107 break; |
| 107 case DrawQuad::SURFACE_CONTENT: | 108 case DrawQuad::SURFACE_CONTENT: |
| 108 Compare(SurfaceDrawQuad::MaterialCast(a), | 109 Compare(SurfaceDrawQuad::MaterialCast(a), |
| 109 SurfaceDrawQuad::MaterialCast(b)); | 110 SurfaceDrawQuad::MaterialCast(b)); |
| 110 break; | 111 break; |
| 111 case DrawQuad::YUV_VIDEO_CONTENT: | 112 case DrawQuad::YUV_VIDEO_CONTENT: |
| 112 Compare(YUVVideoDrawQuad::MaterialCast(a), | 113 Compare(YUVVideoDrawQuad::MaterialCast(a), |
| 113 YUVVideoDrawQuad::MaterialCast(b)); | 114 YUVVideoDrawQuad::MaterialCast(b)); |
| 114 break; | 115 break; |
| 116 case DrawQuad::Y_VIDEO_CONTENT: |
| 117 Compare(YVideoDrawQuad::MaterialCast(a), |
| 118 YVideoDrawQuad::MaterialCast(b)); |
| 119 break; |
| 115 case DrawQuad::INVALID: | 120 case DrawQuad::INVALID: |
| 116 break; | 121 break; |
| 117 } | 122 } |
| 118 } | 123 } |
| 119 | 124 |
| 120 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { | 125 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { |
| 121 EXPECT_EQ(a->color, b->color); | 126 EXPECT_EQ(a->color, b->color); |
| 122 EXPECT_EQ(a->width, b->width); | 127 EXPECT_EQ(a->width, b->width); |
| 123 } | 128 } |
| 124 | 129 |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 EXPECT_TRUE( | 608 EXPECT_TRUE( |
| 604 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); | 609 IPC::ParamTraits<DelegatedFrameData>::Read(&msg, &iter, &frame_out)); |
| 605 | 610 |
| 606 ASSERT_EQ(2u, frame_out.resource_list.size()); | 611 ASSERT_EQ(2u, frame_out.resource_list.size()); |
| 607 Compare(arbitrary_resource1, frame_out.resource_list[0]); | 612 Compare(arbitrary_resource1, frame_out.resource_list[0]); |
| 608 Compare(arbitrary_resource2, frame_out.resource_list[1]); | 613 Compare(arbitrary_resource2, frame_out.resource_list[1]); |
| 609 } | 614 } |
| 610 | 615 |
| 611 } // namespace | 616 } // namespace |
| 612 } // namespace content | 617 } // namespace content |
| OLD | NEW |