| 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 "content/common/cc_messages.h" | 5 #include "content/common/cc_messages.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 EXPECT_EQ(a->tex_coord_rect, b->tex_coord_rect); | 165 EXPECT_EQ(a->tex_coord_rect, b->tex_coord_rect); |
| 166 EXPECT_EQ(a->texture_size, b->texture_size); | 166 EXPECT_EQ(a->texture_size, b->texture_size); |
| 167 EXPECT_EQ(a->swizzle_contents, b->swizzle_contents); | 167 EXPECT_EQ(a->swizzle_contents, b->swizzle_contents); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void Compare(const YUVVideoDrawQuad* a, const YUVVideoDrawQuad* b) { | 170 void Compare(const YUVVideoDrawQuad* a, const YUVVideoDrawQuad* b) { |
| 171 EXPECT_EQ(a->tex_scale, b->tex_scale); | 171 EXPECT_EQ(a->tex_scale, b->tex_scale); |
| 172 EXPECT_EQ(a->y_plane_resource_id, b->y_plane_resource_id); | 172 EXPECT_EQ(a->y_plane_resource_id, b->y_plane_resource_id); |
| 173 EXPECT_EQ(a->u_plane_resource_id, b->u_plane_resource_id); | 173 EXPECT_EQ(a->u_plane_resource_id, b->u_plane_resource_id); |
| 174 EXPECT_EQ(a->v_plane_resource_id, b->v_plane_resource_id); | 174 EXPECT_EQ(a->v_plane_resource_id, b->v_plane_resource_id); |
| 175 EXPECT_EQ(a->a_plane_resource_id, b->a_plane_resource_id); |
| 175 } | 176 } |
| 176 | 177 |
| 177 void Compare(const TransferableResource& a, const TransferableResource& b) { | 178 void Compare(const TransferableResource& a, const TransferableResource& b) { |
| 178 EXPECT_EQ(a.id, b.id); | 179 EXPECT_EQ(a.id, b.id); |
| 179 EXPECT_EQ(a.sync_point, b.sync_point); | 180 EXPECT_EQ(a.sync_point, b.sync_point); |
| 180 EXPECT_EQ(a.format, b.format); | 181 EXPECT_EQ(a.format, b.format); |
| 181 EXPECT_EQ(a.filter, b.filter); | 182 EXPECT_EQ(a.filter, b.filter); |
| 182 EXPECT_EQ(a.size.ToString(), b.size.ToString()); | 183 EXPECT_EQ(a.size.ToString(), b.size.ToString()); |
| 183 for (size_t i = 0; i < arraysize(a.mailbox.name); ++i) | 184 for (size_t i = 0; i < arraysize(a.mailbox.name); ++i) |
| 184 EXPECT_EQ(a.mailbox.name[i], b.mailbox.name[i]); | 185 EXPECT_EQ(a.mailbox.name[i], b.mailbox.name[i]); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 210 bool arbitrary_bool2 = false; | 211 bool arbitrary_bool2 = false; |
| 211 bool arbitrary_bool3 = true; | 212 bool arbitrary_bool3 = true; |
| 212 int arbitrary_int = 5; | 213 int arbitrary_int = 5; |
| 213 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); | 214 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); |
| 214 IOSurfaceDrawQuad::Orientation arbitrary_orientation = | 215 IOSurfaceDrawQuad::Orientation arbitrary_orientation = |
| 215 IOSurfaceDrawQuad::UNFLIPPED; | 216 IOSurfaceDrawQuad::UNFLIPPED; |
| 216 RenderPass::Id arbitrary_id(10, 14); | 217 RenderPass::Id arbitrary_id(10, 14); |
| 217 ResourceProvider::ResourceId arbitrary_resourceid1 = 55; | 218 ResourceProvider::ResourceId arbitrary_resourceid1 = 55; |
| 218 ResourceProvider::ResourceId arbitrary_resourceid2 = 47; | 219 ResourceProvider::ResourceId arbitrary_resourceid2 = 47; |
| 219 ResourceProvider::ResourceId arbitrary_resourceid3 = 23; | 220 ResourceProvider::ResourceId arbitrary_resourceid3 = 23; |
| 221 ResourceProvider::ResourceId arbitrary_resourceid4 = 16; |
| 220 | 222 |
| 221 WebFilterOperations arbitrary_filters1; | 223 WebFilterOperations arbitrary_filters1; |
| 222 arbitrary_filters1.append(WebFilterOperation::createGrayscaleFilter( | 224 arbitrary_filters1.append(WebFilterOperation::createGrayscaleFilter( |
| 223 arbitrary_float1)); | 225 arbitrary_float1)); |
| 224 | 226 |
| 225 WebFilterOperations arbitrary_filters2; | 227 WebFilterOperations arbitrary_filters2; |
| 226 arbitrary_filters2.append(WebFilterOperation::createBrightnessFilter( | 228 arbitrary_filters2.append(WebFilterOperation::createBrightnessFilter( |
| 227 arbitrary_float2)); | 229 arbitrary_float2)); |
| 228 | 230 |
| 229 // TODO(danakj): filter is not serialized. | 231 // TODO(danakj): filter is not serialized. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 scoped_ptr<YUVVideoDrawQuad> yuvvideo_in = | 367 scoped_ptr<YUVVideoDrawQuad> yuvvideo_in = |
| 366 YUVVideoDrawQuad::Create(); | 368 YUVVideoDrawQuad::Create(); |
| 367 yuvvideo_in->SetAll(shared_state1_in.get(), | 369 yuvvideo_in->SetAll(shared_state1_in.get(), |
| 368 arbitrary_rect1, | 370 arbitrary_rect1, |
| 369 arbitrary_rect2, | 371 arbitrary_rect2, |
| 370 arbitrary_rect3, | 372 arbitrary_rect3, |
| 371 arbitrary_bool1, | 373 arbitrary_bool1, |
| 372 arbitrary_sizef1, | 374 arbitrary_sizef1, |
| 373 arbitrary_resourceid1, | 375 arbitrary_resourceid1, |
| 374 arbitrary_resourceid2, | 376 arbitrary_resourceid2, |
| 375 arbitrary_resourceid3); | 377 arbitrary_resourceid3, |
| 378 arbitrary_resourceid4); |
| 376 scoped_ptr<DrawQuad> yuvvideo_cmp = yuvvideo_in->Copy( | 379 scoped_ptr<DrawQuad> yuvvideo_cmp = yuvvideo_in->Copy( |
| 377 yuvvideo_in->shared_quad_state); | 380 yuvvideo_in->shared_quad_state); |
| 378 | 381 |
| 379 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); | 382 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); |
| 380 pass_in->SetAll(arbitrary_id, | 383 pass_in->SetAll(arbitrary_id, |
| 381 arbitrary_rect1, | 384 arbitrary_rect1, |
| 382 arbitrary_rectf1, | 385 arbitrary_rectf1, |
| 383 arbitrary_matrix, | 386 arbitrary_matrix, |
| 384 arbitrary_bool1, | 387 arbitrary_bool1, |
| 385 arbitrary_bool2); | 388 arbitrary_bool2); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, | 521 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, |
| 519 &iter, &frame_out)); | 522 &iter, &frame_out)); |
| 520 | 523 |
| 521 ASSERT_EQ(2u, frame_out.resource_list.size()); | 524 ASSERT_EQ(2u, frame_out.resource_list.size()); |
| 522 Compare(arbitrary_resource1, frame_out.resource_list[0]); | 525 Compare(arbitrary_resource1, frame_out.resource_list[0]); |
| 523 Compare(arbitrary_resource2, frame_out.resource_list[1]); | 526 Compare(arbitrary_resource2, frame_out.resource_list[1]); |
| 524 } | 527 } |
| 525 | 528 |
| 526 } // namespace | 529 } // namespace |
| 527 } // namespace content | 530 } // namespace content |
| OLD | NEW |