| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 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); | |
| 208 EXPECT_EQ(a->bits_per_channel, b->bits_per_channel); | 207 EXPECT_EQ(a->bits_per_channel, b->bits_per_channel); |
| 209 } | 208 } |
| 210 | 209 |
| 211 void Compare(const TransferableResource& a, const TransferableResource& b) { | 210 void Compare(const TransferableResource& a, const TransferableResource& b) { |
| 212 EXPECT_EQ(a.id, b.id); | 211 EXPECT_EQ(a.id, b.id); |
| 213 EXPECT_EQ(a.format, b.format); | 212 EXPECT_EQ(a.format, b.format); |
| 214 EXPECT_EQ(a.filter, b.filter); | 213 EXPECT_EQ(a.filter, b.filter); |
| 215 EXPECT_EQ(a.size.ToString(), b.size.ToString()); | 214 EXPECT_EQ(a.size.ToString(), b.size.ToString()); |
| 216 for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) { | 215 for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) { |
| 217 EXPECT_EQ(a.mailbox_holder.mailbox.name[i], | 216 EXPECT_EQ(a.mailbox_holder.mailbox.name[i], |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); | 273 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); |
| 275 SkBlendMode arbitrary_blend_mode1 = SkBlendMode::kScreen; | 274 SkBlendMode arbitrary_blend_mode1 = SkBlendMode::kScreen; |
| 276 SkBlendMode arbitrary_blend_mode2 = SkBlendMode::kLighten; | 275 SkBlendMode arbitrary_blend_mode2 = SkBlendMode::kLighten; |
| 277 SkBlendMode arbitrary_blend_mode3 = SkBlendMode::kOverlay; | 276 SkBlendMode arbitrary_blend_mode3 = SkBlendMode::kOverlay; |
| 278 ResourceId arbitrary_resourceid1 = 55; | 277 ResourceId arbitrary_resourceid1 = 55; |
| 279 ResourceId arbitrary_resourceid2 = 47; | 278 ResourceId arbitrary_resourceid2 = 47; |
| 280 ResourceId arbitrary_resourceid3 = 23; | 279 ResourceId arbitrary_resourceid3 = 23; |
| 281 ResourceId arbitrary_resourceid4 = 16; | 280 ResourceId arbitrary_resourceid4 = 16; |
| 282 SkScalar arbitrary_sigma = SkFloatToScalar(2.0f); | 281 SkScalar arbitrary_sigma = SkFloatToScalar(2.0f); |
| 283 gfx::ColorSpace arbitrary_color_space = gfx::ColorSpace::CreateREC601(); | 282 gfx::ColorSpace arbitrary_color_space = gfx::ColorSpace::CreateREC601(); |
| 284 YUVVideoDrawQuad::ColorSpace arbitrary_video_color_space = | |
| 285 YUVVideoDrawQuad::REC_601; | |
| 286 | 283 |
| 287 int child_id = 30; | 284 int child_id = 30; |
| 288 int root_id = 14; | 285 int root_id = 14; |
| 289 | 286 |
| 290 FilterOperations arbitrary_filters1; | 287 FilterOperations arbitrary_filters1; |
| 291 arbitrary_filters1.Append( | 288 arbitrary_filters1.Append( |
| 292 FilterOperation::CreateGrayscaleFilter(arbitrary_float1)); | 289 FilterOperation::CreateGrayscaleFilter(arbitrary_float1)); |
| 293 arbitrary_filters1.Append(cc::FilterOperation::CreateReferenceFilter( | 290 arbitrary_filters1.Append(cc::FilterOperation::CreateReferenceFilter( |
| 294 SkBlurImageFilter::Make(arbitrary_sigma, arbitrary_sigma, nullptr))); | 291 SkBlurImageFilter::Make(arbitrary_sigma, arbitrary_sigma, nullptr))); |
| 295 | 292 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 arbitrary_size1, arbitrary_bool2, arbitrary_bool3); | 409 arbitrary_size1, arbitrary_bool2, arbitrary_bool3); |
| 413 pass_cmp->CopyFromAndAppendDrawQuad(tile_in, tile_in->shared_quad_state); | 410 pass_cmp->CopyFromAndAppendDrawQuad(tile_in, tile_in->shared_quad_state); |
| 414 | 411 |
| 415 YUVVideoDrawQuad* yuvvideo_in = | 412 YUVVideoDrawQuad* yuvvideo_in = |
| 416 pass_in->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | 413 pass_in->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
| 417 yuvvideo_in->SetAll( | 414 yuvvideo_in->SetAll( |
| 418 shared_state3_in, arbitrary_rect1, arbitrary_rect2_inside_rect1, | 415 shared_state3_in, arbitrary_rect1, arbitrary_rect2_inside_rect1, |
| 419 arbitrary_rect1_inside_rect1, arbitrary_bool1, arbitrary_rectf1, | 416 arbitrary_rect1_inside_rect1, arbitrary_bool1, arbitrary_rectf1, |
| 420 arbitrary_rectf2, arbitrary_size1, arbitrary_size2, arbitrary_resourceid1, | 417 arbitrary_rectf2, arbitrary_size1, arbitrary_size2, arbitrary_resourceid1, |
| 421 arbitrary_resourceid2, arbitrary_resourceid3, arbitrary_resourceid4, | 418 arbitrary_resourceid2, arbitrary_resourceid3, arbitrary_resourceid4, |
| 422 arbitrary_video_color_space, arbitrary_color_space, arbitrary_float1, | 419 arbitrary_float1, arbitrary_float2, arbitrary_int); |
| 423 arbitrary_float2, arbitrary_int); | |
| 424 pass_cmp->CopyFromAndAppendDrawQuad(yuvvideo_in, | 420 pass_cmp->CopyFromAndAppendDrawQuad(yuvvideo_in, |
| 425 yuvvideo_in->shared_quad_state); | 421 yuvvideo_in->shared_quad_state); |
| 426 | 422 |
| 427 // Make sure the in and cmp RenderPasses match. | 423 // Make sure the in and cmp RenderPasses match. |
| 428 Compare(child_pass_cmp.get(), child_pass_in.get()); | 424 Compare(child_pass_cmp.get(), child_pass_in.get()); |
| 429 ASSERT_EQ(0u, child_pass_in->shared_quad_state_list.size()); | 425 ASSERT_EQ(0u, child_pass_in->shared_quad_state_list.size()); |
| 430 ASSERT_EQ(0u, child_pass_in->quad_list.size()); | 426 ASSERT_EQ(0u, child_pass_in->quad_list.size()); |
| 431 Compare(pass_cmp.get(), pass_in.get()); | 427 Compare(pass_cmp.get(), pass_in.get()); |
| 432 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size()); | 428 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size()); |
| 433 ASSERT_EQ(8u, pass_in->quad_list.size()); | 429 ASSERT_EQ(8u, pass_in->quad_list.size()); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 cc::SurfaceInfo surface_info_out; | 642 cc::SurfaceInfo surface_info_out; |
| 647 base::PickleIterator iter(msg); | 643 base::PickleIterator iter(msg); |
| 648 EXPECT_TRUE( | 644 EXPECT_TRUE( |
| 649 IPC::ParamTraits<cc::SurfaceInfo>::Read(&msg, &iter, &surface_info_out)); | 645 IPC::ParamTraits<cc::SurfaceInfo>::Read(&msg, &iter, &surface_info_out)); |
| 650 | 646 |
| 651 ASSERT_EQ(surface_info_in, surface_info_out); | 647 ASSERT_EQ(surface_info_in, surface_info_out); |
| 652 } | 648 } |
| 653 | 649 |
| 654 } // namespace | 650 } // namespace |
| 655 } // namespace content | 651 } // namespace content |
| OLD | NEW |