| 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 <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { | 125 void Compare(const DebugBorderDrawQuad* a, const DebugBorderDrawQuad* b) { |
| 126 EXPECT_EQ(a->color, b->color); | 126 EXPECT_EQ(a->color, b->color); |
| 127 EXPECT_EQ(a->width, b->width); | 127 EXPECT_EQ(a->width, b->width); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void Compare(const IOSurfaceDrawQuad* a, const IOSurfaceDrawQuad* b) { | 130 void Compare(const IOSurfaceDrawQuad* a, const IOSurfaceDrawQuad* b) { |
| 131 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString()); | 131 EXPECT_EQ(a->io_surface_size.ToString(), b->io_surface_size.ToString()); |
| 132 EXPECT_EQ(a->io_surface_resource_id(), b->io_surface_resource_id()); | 132 EXPECT_EQ(a->io_surface_resource_id(), b->io_surface_resource_id()); |
| 133 EXPECT_EQ(a->orientation, b->orientation); | 133 EXPECT_EQ(a->orientation, b->orientation); |
| 134 EXPECT_EQ(a->allow_overlay, b->allow_overlay); | |
| 135 } | 134 } |
| 136 | 135 |
| 137 void Compare(const RenderPassDrawQuad* a, const RenderPassDrawQuad* b) { | 136 void Compare(const RenderPassDrawQuad* a, const RenderPassDrawQuad* b) { |
| 138 EXPECT_EQ(a->render_pass_id, b->render_pass_id); | 137 EXPECT_EQ(a->render_pass_id, b->render_pass_id); |
| 139 EXPECT_EQ(a->mask_resource_id(), b->mask_resource_id()); | 138 EXPECT_EQ(a->mask_resource_id(), b->mask_resource_id()); |
| 140 EXPECT_EQ(a->mask_uv_scale.ToString(), b->mask_uv_scale.ToString()); | 139 EXPECT_EQ(a->mask_uv_scale.ToString(), b->mask_uv_scale.ToString()); |
| 141 EXPECT_EQ(a->mask_texture_size.ToString(), b->mask_texture_size.ToString()); | 140 EXPECT_EQ(a->mask_texture_size.ToString(), b->mask_texture_size.ToString()); |
| 142 EXPECT_EQ(a->filters.size(), b->filters.size()); | 141 EXPECT_EQ(a->filters.size(), b->filters.size()); |
| 143 for (size_t i = 0; i < a->filters.size(); ++i) { | 142 for (size_t i = 0; i < a->filters.size(); ++i) { |
| 144 if (a->filters.at(i).type() != cc::FilterOperation::REFERENCE) { | 143 if (a->filters.at(i).type() != cc::FilterOperation::REFERENCE) { |
| 145 EXPECT_EQ(a->filters.at(i), b->filters.at(i)); | 144 EXPECT_EQ(a->filters.at(i), b->filters.at(i)); |
| 146 } else { | 145 } else { |
| 147 EXPECT_EQ(b->filters.at(i).type(), cc::FilterOperation::REFERENCE); | 146 EXPECT_EQ(b->filters.at(i).type(), cc::FilterOperation::REFERENCE); |
| 148 EXPECT_EQ(a->filters.at(i).image_filter()->countInputs(), | 147 EXPECT_EQ(a->filters.at(i).image_filter()->countInputs(), |
| 149 b->filters.at(i).image_filter()->countInputs()); | 148 b->filters.at(i).image_filter()->countInputs()); |
| 150 } | 149 } |
| 151 } | 150 } |
| 152 EXPECT_EQ(a->filters_scale, b->filters_scale); | 151 EXPECT_EQ(a->filters_scale, b->filters_scale); |
| 153 EXPECT_EQ(a->background_filters, b->background_filters); | 152 EXPECT_EQ(a->background_filters, b->background_filters); |
| 154 } | 153 } |
| 155 | 154 |
| 156 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) { | 155 void Compare(const SolidColorDrawQuad* a, const SolidColorDrawQuad* b) { |
| 157 EXPECT_EQ(a->color, b->color); | 156 EXPECT_EQ(a->color, b->color); |
| 158 EXPECT_EQ(a->force_anti_aliasing_off, b->force_anti_aliasing_off); | 157 EXPECT_EQ(a->force_anti_aliasing_off, b->force_anti_aliasing_off); |
| 159 } | 158 } |
| 160 | 159 |
| 161 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) { | 160 void Compare(const StreamVideoDrawQuad* a, const StreamVideoDrawQuad* b) { |
| 162 EXPECT_EQ(a->resource_id(), b->resource_id()); | 161 EXPECT_EQ(a->resource_id(), b->resource_id()); |
| 163 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); | 162 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); |
| 164 EXPECT_EQ(a->allow_overlay(), b->allow_overlay()); | |
| 165 EXPECT_EQ(a->matrix, b->matrix); | 163 EXPECT_EQ(a->matrix, b->matrix); |
| 166 } | 164 } |
| 167 | 165 |
| 168 void Compare(const SurfaceDrawQuad* a, const SurfaceDrawQuad* b) { | 166 void Compare(const SurfaceDrawQuad* a, const SurfaceDrawQuad* b) { |
| 169 EXPECT_EQ(a->surface_id, b->surface_id); | 167 EXPECT_EQ(a->surface_id, b->surface_id); |
| 170 } | 168 } |
| 171 | 169 |
| 172 void Compare(const TextureDrawQuad* a, const TextureDrawQuad* b) { | 170 void Compare(const TextureDrawQuad* a, const TextureDrawQuad* b) { |
| 173 EXPECT_EQ(a->resource_id(), b->resource_id()); | 171 EXPECT_EQ(a->resource_id(), b->resource_id()); |
| 174 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); | 172 EXPECT_EQ(a->resource_size_in_pixels(), b->resource_size_in_pixels()); |
| 175 EXPECT_EQ(a->allow_overlay(), b->allow_overlay()); | |
| 176 EXPECT_EQ(a->premultiplied_alpha, b->premultiplied_alpha); | 173 EXPECT_EQ(a->premultiplied_alpha, b->premultiplied_alpha); |
| 177 EXPECT_EQ(a->uv_top_left, b->uv_top_left); | 174 EXPECT_EQ(a->uv_top_left, b->uv_top_left); |
| 178 EXPECT_EQ(a->uv_bottom_right, b->uv_bottom_right); | 175 EXPECT_EQ(a->uv_bottom_right, b->uv_bottom_right); |
| 179 EXPECT_EQ(a->background_color, b->background_color); | 176 EXPECT_EQ(a->background_color, b->background_color); |
| 180 EXPECT_EQ(a->vertex_opacity[0], b->vertex_opacity[0]); | 177 EXPECT_EQ(a->vertex_opacity[0], b->vertex_opacity[0]); |
| 181 EXPECT_EQ(a->vertex_opacity[1], b->vertex_opacity[1]); | 178 EXPECT_EQ(a->vertex_opacity[1], b->vertex_opacity[1]); |
| 182 EXPECT_EQ(a->vertex_opacity[2], b->vertex_opacity[2]); | 179 EXPECT_EQ(a->vertex_opacity[2], b->vertex_opacity[2]); |
| 183 EXPECT_EQ(a->vertex_opacity[3], b->vertex_opacity[3]); | 180 EXPECT_EQ(a->vertex_opacity[3], b->vertex_opacity[3]); |
| 184 EXPECT_EQ(a->y_flipped, b->y_flipped); | 181 EXPECT_EQ(a->y_flipped, b->y_flipped); |
| 185 EXPECT_EQ(a->nearest_neighbor, b->nearest_neighbor); | 182 EXPECT_EQ(a->nearest_neighbor, b->nearest_neighbor); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 209 EXPECT_EQ(a.id, b.id); | 206 EXPECT_EQ(a.id, b.id); |
| 210 EXPECT_EQ(a.format, b.format); | 207 EXPECT_EQ(a.format, b.format); |
| 211 EXPECT_EQ(a.filter, b.filter); | 208 EXPECT_EQ(a.filter, b.filter); |
| 212 EXPECT_EQ(a.size.ToString(), b.size.ToString()); | 209 EXPECT_EQ(a.size.ToString(), b.size.ToString()); |
| 213 for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) { | 210 for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) { |
| 214 EXPECT_EQ(a.mailbox_holder.mailbox.name[i], | 211 EXPECT_EQ(a.mailbox_holder.mailbox.name[i], |
| 215 b.mailbox_holder.mailbox.name[i]); | 212 b.mailbox_holder.mailbox.name[i]); |
| 216 } | 213 } |
| 217 EXPECT_EQ(a.mailbox_holder.texture_target, b.mailbox_holder.texture_target); | 214 EXPECT_EQ(a.mailbox_holder.texture_target, b.mailbox_holder.texture_target); |
| 218 EXPECT_EQ(a.mailbox_holder.sync_point, b.mailbox_holder.sync_point); | 215 EXPECT_EQ(a.mailbox_holder.sync_point, b.mailbox_holder.sync_point); |
| 219 EXPECT_EQ(a.allow_overlay, b.allow_overlay); | 216 EXPECT_EQ(a.is_overlay_candidate, b.is_overlay_candidate); |
| 220 } | 217 } |
| 221 }; | 218 }; |
| 222 | 219 |
| 223 TEST_F(CCMessagesTest, AllQuads) { | 220 TEST_F(CCMessagesTest, AllQuads) { |
| 224 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); | 221 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); |
| 225 | 222 |
| 226 Transform arbitrary_matrix1; | 223 Transform arbitrary_matrix1; |
| 227 arbitrary_matrix1.Scale(3, 3); | 224 arbitrary_matrix1.Scale(3, 3); |
| 228 arbitrary_matrix1.Translate(-5, 20); | 225 arbitrary_matrix1.Translate(-5, 20); |
| 229 arbitrary_matrix1.Rotate(15); | 226 arbitrary_matrix1.Rotate(15); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 int arbitrary_context_id1 = 12; | 259 int arbitrary_context_id1 = 12; |
| 263 int arbitrary_context_id2 = 57; | 260 int arbitrary_context_id2 = 57; |
| 264 int arbitrary_context_id3 = -503; | 261 int arbitrary_context_id3 = -503; |
| 265 int arbitrary_int = 5; | 262 int arbitrary_int = 5; |
| 266 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); | 263 SkColor arbitrary_color = SkColorSetARGB(25, 36, 47, 58); |
| 267 SkXfermode::Mode arbitrary_blend_mode1 = SkXfermode::kScreen_Mode; | 264 SkXfermode::Mode arbitrary_blend_mode1 = SkXfermode::kScreen_Mode; |
| 268 SkXfermode::Mode arbitrary_blend_mode2 = SkXfermode::kLighten_Mode; | 265 SkXfermode::Mode arbitrary_blend_mode2 = SkXfermode::kLighten_Mode; |
| 269 SkXfermode::Mode arbitrary_blend_mode3 = SkXfermode::kOverlay_Mode; | 266 SkXfermode::Mode arbitrary_blend_mode3 = SkXfermode::kOverlay_Mode; |
| 270 IOSurfaceDrawQuad::Orientation arbitrary_orientation = | 267 IOSurfaceDrawQuad::Orientation arbitrary_orientation = |
| 271 IOSurfaceDrawQuad::UNFLIPPED; | 268 IOSurfaceDrawQuad::UNFLIPPED; |
| 272 bool arbitrary_allow_overlay = true; | |
| 273 ResourceId arbitrary_resourceid1 = 55; | 269 ResourceId arbitrary_resourceid1 = 55; |
| 274 ResourceId arbitrary_resourceid2 = 47; | 270 ResourceId arbitrary_resourceid2 = 47; |
| 275 ResourceId arbitrary_resourceid3 = 23; | 271 ResourceId arbitrary_resourceid3 = 23; |
| 276 ResourceId arbitrary_resourceid4 = 16; | 272 ResourceId arbitrary_resourceid4 = 16; |
| 277 SkScalar arbitrary_sigma = SkFloatToScalar(2.0f); | 273 SkScalar arbitrary_sigma = SkFloatToScalar(2.0f); |
| 278 YUVVideoDrawQuad::ColorSpace arbitrary_color_space = | 274 YUVVideoDrawQuad::ColorSpace arbitrary_color_space = |
| 279 YUVVideoDrawQuad::REC_601; | 275 YUVVideoDrawQuad::REC_601; |
| 280 | 276 |
| 281 RenderPassId child_id(30, 5); | 277 RenderPassId child_id(30, 5); |
| 282 RenderPassId root_id(10, 14); | 278 RenderPassId root_id(10, 14); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 328 |
| 333 IOSurfaceDrawQuad* iosurface_in = | 329 IOSurfaceDrawQuad* iosurface_in = |
| 334 pass_in->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>(); | 330 pass_in->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>(); |
| 335 iosurface_in->SetAll(shared_state1_in, | 331 iosurface_in->SetAll(shared_state1_in, |
| 336 arbitrary_rect2, | 332 arbitrary_rect2, |
| 337 arbitrary_rect2_inside_rect2, | 333 arbitrary_rect2_inside_rect2, |
| 338 arbitrary_rect1_inside_rect2, | 334 arbitrary_rect1_inside_rect2, |
| 339 arbitrary_bool1, | 335 arbitrary_bool1, |
| 340 arbitrary_size1, | 336 arbitrary_size1, |
| 341 arbitrary_resourceid3, | 337 arbitrary_resourceid3, |
| 342 arbitrary_orientation, | 338 arbitrary_orientation); |
| 343 arbitrary_allow_overlay); | |
| 344 pass_cmp->CopyFromAndAppendDrawQuad(iosurface_in, | 339 pass_cmp->CopyFromAndAppendDrawQuad(iosurface_in, |
| 345 iosurface_in->shared_quad_state); | 340 iosurface_in->shared_quad_state); |
| 346 | 341 |
| 347 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); | 342 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); |
| 348 shared_state2_in->SetAll(arbitrary_matrix2, arbitrary_size2, arbitrary_rect2, | 343 shared_state2_in->SetAll(arbitrary_matrix2, arbitrary_size2, arbitrary_rect2, |
| 349 arbitrary_rect3, arbitrary_bool1, arbitrary_float2, | 344 arbitrary_rect3, arbitrary_bool1, arbitrary_float2, |
| 350 arbitrary_blend_mode2, arbitrary_context_id2); | 345 arbitrary_blend_mode2, arbitrary_context_id2); |
| 351 SharedQuadState* shared_state2_cmp = | 346 SharedQuadState* shared_state2_cmp = |
| 352 pass_cmp->CreateAndAppendSharedQuadState(); | 347 pass_cmp->CreateAndAppendSharedQuadState(); |
| 353 shared_state2_cmp->CopyFrom(shared_state2_in); | 348 shared_state2_cmp->CopyFrom(shared_state2_in); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 382 arbitrary_color, | 377 arbitrary_color, |
| 383 arbitrary_bool2); | 378 arbitrary_bool2); |
| 384 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in, | 379 pass_cmp->CopyFromAndAppendDrawQuad(solidcolor_in, |
| 385 solidcolor_in->shared_quad_state); | 380 solidcolor_in->shared_quad_state); |
| 386 | 381 |
| 387 StreamVideoDrawQuad* streamvideo_in = | 382 StreamVideoDrawQuad* streamvideo_in = |
| 388 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); | 383 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); |
| 389 streamvideo_in->SetAll( | 384 streamvideo_in->SetAll( |
| 390 shared_state3_in, arbitrary_rect2, arbitrary_rect2_inside_rect2, | 385 shared_state3_in, arbitrary_rect2, arbitrary_rect2_inside_rect2, |
| 391 arbitrary_rect1_inside_rect2, arbitrary_bool1, arbitrary_resourceid2, | 386 arbitrary_rect1_inside_rect2, arbitrary_bool1, arbitrary_resourceid2, |
| 392 arbitrary_size1, arbitrary_bool2, arbitrary_matrix1); | 387 arbitrary_size1, arbitrary_matrix1); |
| 393 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in, | 388 pass_cmp->CopyFromAndAppendDrawQuad(streamvideo_in, |
| 394 streamvideo_in->shared_quad_state); | 389 streamvideo_in->shared_quad_state); |
| 395 | 390 |
| 396 cc::SurfaceId arbitrary_surface_id(3); | 391 cc::SurfaceId arbitrary_surface_id(3); |
| 397 SurfaceDrawQuad* surface_in = | 392 SurfaceDrawQuad* surface_in = |
| 398 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 393 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
| 399 surface_in->SetAll(shared_state3_in, | 394 surface_in->SetAll(shared_state3_in, |
| 400 arbitrary_rect2, | 395 arbitrary_rect2, |
| 401 arbitrary_rect2_inside_rect2, | 396 arbitrary_rect2_inside_rect2, |
| 402 arbitrary_rect1_inside_rect2, | 397 arbitrary_rect1_inside_rect2, |
| 403 arbitrary_bool1, | 398 arbitrary_bool1, |
| 404 arbitrary_surface_id); | 399 arbitrary_surface_id); |
| 405 pass_cmp->CopyFromAndAppendDrawQuad(surface_in, | 400 pass_cmp->CopyFromAndAppendDrawQuad(surface_in, |
| 406 surface_in->shared_quad_state); | 401 surface_in->shared_quad_state); |
| 407 pass_in->referenced_surfaces.push_back(arbitrary_surface_id); | 402 pass_in->referenced_surfaces.push_back(arbitrary_surface_id); |
| 408 pass_cmp->referenced_surfaces.push_back(arbitrary_surface_id); | 403 pass_cmp->referenced_surfaces.push_back(arbitrary_surface_id); |
| 409 | 404 |
| 410 TextureDrawQuad* texture_in = | 405 TextureDrawQuad* texture_in = |
| 411 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 406 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| 412 texture_in->SetAll(shared_state3_in, arbitrary_rect2, | 407 texture_in->SetAll(shared_state3_in, arbitrary_rect2, |
| 413 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2, | 408 arbitrary_rect2_inside_rect2, arbitrary_rect1_inside_rect2, |
| 414 arbitrary_bool1, arbitrary_resourceid1, arbitrary_size1, | 409 arbitrary_bool1, arbitrary_resourceid1, arbitrary_size1, |
| 415 arbitrary_bool2, arbitrary_bool3, arbitrary_pointf1, | 410 arbitrary_bool2, arbitrary_pointf1, |
| 416 arbitrary_pointf2, arbitrary_color, arbitrary_float_array, | 411 arbitrary_pointf2, arbitrary_color, arbitrary_float_array, |
| 417 arbitrary_bool4, arbitrary_bool5); | 412 arbitrary_bool4, arbitrary_bool5); |
| 418 pass_cmp->CopyFromAndAppendDrawQuad(texture_in, | 413 pass_cmp->CopyFromAndAppendDrawQuad(texture_in, |
| 419 texture_in->shared_quad_state); | 414 texture_in->shared_quad_state); |
| 420 | 415 |
| 421 TileDrawQuad* tile_in = pass_in->CreateAndAppendDrawQuad<TileDrawQuad>(); | 416 TileDrawQuad* tile_in = pass_in->CreateAndAppendDrawQuad<TileDrawQuad>(); |
| 422 tile_in->SetAll(shared_state3_in, | 417 tile_in->SetAll(shared_state3_in, |
| 423 arbitrary_rect2, | 418 arbitrary_rect2, |
| 424 arbitrary_rect2_inside_rect2, | 419 arbitrary_rect2_inside_rect2, |
| 425 arbitrary_rect1_inside_rect2, | 420 arbitrary_rect1_inside_rect2, |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7}; | 633 6, 5, 4, 3, 2, 1, 9, 7, 5, 3, 1, 2, 4, 6, 8, 0, 0, 9, 8, 7}; |
| 639 | 634 |
| 640 TransferableResource arbitrary_resource1; | 635 TransferableResource arbitrary_resource1; |
| 641 arbitrary_resource1.id = 2178312; | 636 arbitrary_resource1.id = 2178312; |
| 642 arbitrary_resource1.format = cc::RGBA_8888; | 637 arbitrary_resource1.format = cc::RGBA_8888; |
| 643 arbitrary_resource1.filter = 53; | 638 arbitrary_resource1.filter = 53; |
| 644 arbitrary_resource1.size = gfx::Size(37189, 123123); | 639 arbitrary_resource1.size = gfx::Size(37189, 123123); |
| 645 arbitrary_resource1.mailbox_holder.mailbox.SetName(arbitrary_mailbox1); | 640 arbitrary_resource1.mailbox_holder.mailbox.SetName(arbitrary_mailbox1); |
| 646 arbitrary_resource1.mailbox_holder.texture_target = GL_TEXTURE_2D; | 641 arbitrary_resource1.mailbox_holder.texture_target = GL_TEXTURE_2D; |
| 647 arbitrary_resource1.mailbox_holder.sync_point = arbitrary_uint1; | 642 arbitrary_resource1.mailbox_holder.sync_point = arbitrary_uint1; |
| 648 arbitrary_resource1.allow_overlay = true; | 643 arbitrary_resource1.is_overlay_candidate = true; |
| 649 | 644 |
| 650 TransferableResource arbitrary_resource2; | 645 TransferableResource arbitrary_resource2; |
| 651 arbitrary_resource2.id = 789132; | 646 arbitrary_resource2.id = 789132; |
| 652 arbitrary_resource2.format = cc::RGBA_4444; | 647 arbitrary_resource2.format = cc::RGBA_4444; |
| 653 arbitrary_resource2.filter = 47; | 648 arbitrary_resource2.filter = 47; |
| 654 arbitrary_resource2.size = gfx::Size(89123, 23789); | 649 arbitrary_resource2.size = gfx::Size(89123, 23789); |
| 655 arbitrary_resource2.mailbox_holder.mailbox.SetName(arbitrary_mailbox2); | 650 arbitrary_resource2.mailbox_holder.mailbox.SetName(arbitrary_mailbox2); |
| 656 arbitrary_resource2.mailbox_holder.texture_target = GL_TEXTURE_EXTERNAL_OES; | 651 arbitrary_resource2.mailbox_holder.texture_target = GL_TEXTURE_EXTERNAL_OES; |
| 657 arbitrary_resource2.mailbox_holder.sync_point = arbitrary_uint2; | 652 arbitrary_resource2.mailbox_holder.sync_point = arbitrary_uint2; |
| 658 arbitrary_resource2.allow_overlay = false; | 653 arbitrary_resource2.is_overlay_candidate = false; |
| 659 | 654 |
| 660 scoped_ptr<RenderPass> renderpass_in = RenderPass::Create(); | 655 scoped_ptr<RenderPass> renderpass_in = RenderPass::Create(); |
| 661 renderpass_in->SetNew( | 656 renderpass_in->SetNew( |
| 662 RenderPassId(1, 1), gfx::Rect(), gfx::Rect(), gfx::Transform()); | 657 RenderPassId(1, 1), gfx::Rect(), gfx::Rect(), gfx::Transform()); |
| 663 | 658 |
| 664 DelegatedFrameData frame_in; | 659 DelegatedFrameData frame_in; |
| 665 frame_in.resource_list.push_back(arbitrary_resource1); | 660 frame_in.resource_list.push_back(arbitrary_resource1); |
| 666 frame_in.resource_list.push_back(arbitrary_resource2); | 661 frame_in.resource_list.push_back(arbitrary_resource2); |
| 667 frame_in.render_pass_list.push_back(renderpass_in.Pass()); | 662 frame_in.render_pass_list.push_back(renderpass_in.Pass()); |
| 668 | 663 |
| 669 IPC::ParamTraits<DelegatedFrameData>::Write(&msg, frame_in); | 664 IPC::ParamTraits<DelegatedFrameData>::Write(&msg, frame_in); |
| 670 | 665 |
| 671 DelegatedFrameData frame_out; | 666 DelegatedFrameData frame_out; |
| 672 base::PickleIterator iter(msg); | 667 base::PickleIterator iter(msg); |
| 673 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, | 668 EXPECT_TRUE(IPC::ParamTraits<DelegatedFrameData>::Read(&msg, |
| 674 &iter, &frame_out)); | 669 &iter, &frame_out)); |
| 675 | 670 |
| 676 ASSERT_EQ(2u, frame_out.resource_list.size()); | 671 ASSERT_EQ(2u, frame_out.resource_list.size()); |
| 677 Compare(arbitrary_resource1, frame_out.resource_list[0]); | 672 Compare(arbitrary_resource1, frame_out.resource_list[0]); |
| 678 Compare(arbitrary_resource2, frame_out.resource_list[1]); | 673 Compare(arbitrary_resource2, frame_out.resource_list[1]); |
| 679 } | 674 } |
| 680 | 675 |
| 681 } // namespace | 676 } // namespace |
| 682 } // namespace content | 677 } // namespace content |
| OLD | NEW |