| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 pass_cmp->SetAll(arbitrary_id, | 300 pass_cmp->SetAll(arbitrary_id, |
| 301 arbitrary_rect1, | 301 arbitrary_rect1, |
| 302 arbitrary_rect2, | 302 arbitrary_rect2, |
| 303 arbitrary_matrix, | 303 arbitrary_matrix, |
| 304 arbitrary_bool1); | 304 arbitrary_bool1); |
| 305 | 305 |
| 306 SharedQuadState* shared_state1_cmp = | 306 SharedQuadState* shared_state1_cmp = |
| 307 pass_cmp->CreateAndAppendSharedQuadState(); | 307 pass_cmp->CreateAndAppendSharedQuadState(); |
| 308 shared_state1_cmp->CopyFrom(shared_state1_in); | 308 shared_state1_cmp->CopyFrom(shared_state1_in); |
| 309 | 309 |
| 310 scoped_ptr<CheckerboardDrawQuad> checkerboard_in = | 310 CheckerboardDrawQuad* checkerboard_in = |
| 311 CheckerboardDrawQuad::Create(); | 311 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); |
| 312 checkerboard_in->SetAll(shared_state1_in, | 312 checkerboard_in->SetAll(shared_state1_in, |
| 313 arbitrary_rect1, | 313 arbitrary_rect1, |
| 314 arbitrary_rect2_inside_rect1, | 314 arbitrary_rect2_inside_rect1, |
| 315 arbitrary_rect1_inside_rect1, | 315 arbitrary_rect1_inside_rect1, |
| 316 arbitrary_bool1, | 316 arbitrary_bool1, |
| 317 arbitrary_color); | 317 arbitrary_color); |
| 318 scoped_ptr<DrawQuad> checkerboard_cmp = checkerboard_in->Copy( | 318 CheckerboardDrawQuad* checkerboard_cmp = |
| 319 checkerboard_in->shared_quad_state); | 319 pass_cmp->CopyFromAndAppendDrawQuad<CheckerboardDrawQuad>( |
| 320 checkerboard_in); |
| 321 checkerboard_cmp->shared_quad_state = checkerboard_in->shared_quad_state; |
| 320 | 322 |
| 321 scoped_ptr<DebugBorderDrawQuad> debugborder_in = | 323 DebugBorderDrawQuad* debugborder_in = |
| 322 DebugBorderDrawQuad::Create(); | 324 pass_in->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); |
| 323 debugborder_in->SetAll(shared_state1_in, | 325 debugborder_in->SetAll(shared_state1_in, |
| 324 arbitrary_rect3, | 326 arbitrary_rect3, |
| 325 arbitrary_rect1_inside_rect3, | 327 arbitrary_rect1_inside_rect3, |
| 326 arbitrary_rect2_inside_rect3, | 328 arbitrary_rect2_inside_rect3, |
| 327 arbitrary_bool1, | 329 arbitrary_bool1, |
| 328 arbitrary_color, | 330 arbitrary_color, |
| 329 arbitrary_int); | 331 arbitrary_int); |
| 330 scoped_ptr<DrawQuad> debugborder_cmp = debugborder_in->Copy( | 332 DebugBorderDrawQuad* debugborder_cmp = |
| 331 debugborder_in->shared_quad_state); | 333 pass_cmp->CopyFromAndAppendDrawQuad<DebugBorderDrawQuad>(debugborder_in); |
| 334 debugborder_cmp->shared_quad_state = debugborder_in->shared_quad_state; |
| 332 | 335 |
| 333 scoped_ptr<IOSurfaceDrawQuad> iosurface_in = | 336 IOSurfaceDrawQuad* iosurface_in = |
| 334 IOSurfaceDrawQuad::Create(); | 337 pass_in->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>(); |
| 335 iosurface_in->SetAll(shared_state1_in, | 338 iosurface_in->SetAll(shared_state1_in, |
| 336 arbitrary_rect2, | 339 arbitrary_rect2, |
| 337 arbitrary_rect2_inside_rect2, | 340 arbitrary_rect2_inside_rect2, |
| 338 arbitrary_rect1_inside_rect2, | 341 arbitrary_rect1_inside_rect2, |
| 339 arbitrary_bool1, | 342 arbitrary_bool1, |
| 340 arbitrary_size1, | 343 arbitrary_size1, |
| 341 arbitrary_resourceid3, | 344 arbitrary_resourceid3, |
| 342 arbitrary_orientation); | 345 arbitrary_orientation); |
| 343 scoped_ptr<DrawQuad> iosurface_cmp = iosurface_in->Copy( | 346 IOSurfaceDrawQuad* iosurface_cmp = |
| 344 iosurface_in->shared_quad_state); | 347 pass_cmp->CopyFromAndAppendDrawQuad<IOSurfaceDrawQuad>(iosurface_in); |
| 348 iosurface_cmp->shared_quad_state = iosurface_in->shared_quad_state; |
| 345 | 349 |
| 346 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); | 350 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); |
| 347 shared_state2_in->SetAll(arbitrary_matrix, | 351 shared_state2_in->SetAll(arbitrary_matrix, |
| 348 arbitrary_size2, | 352 arbitrary_size2, |
| 349 arbitrary_rect2, | 353 arbitrary_rect2, |
| 350 arbitrary_rect3, | 354 arbitrary_rect3, |
| 351 arbitrary_bool1, | 355 arbitrary_bool1, |
| 352 arbitrary_float2, | 356 arbitrary_float2, |
| 353 arbitrary_blend_mode2, | 357 arbitrary_blend_mode2, |
| 354 arbitrary_context_id2); | 358 arbitrary_context_id2); |
| 355 SharedQuadState* shared_state2_cmp = | 359 SharedQuadState* shared_state2_cmp = |
| 356 pass_cmp->CreateAndAppendSharedQuadState(); | 360 pass_cmp->CreateAndAppendSharedQuadState(); |
| 357 shared_state2_cmp->CopyFrom(shared_state2_in); | 361 shared_state2_cmp->CopyFrom(shared_state2_in); |
| 358 | 362 |
| 359 scoped_ptr<RenderPassDrawQuad> renderpass_in = | 363 RenderPassDrawQuad* renderpass_in = |
| 360 RenderPassDrawQuad::Create(); | 364 pass_in->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
| 361 renderpass_in->SetAll(shared_state2_in, | 365 renderpass_in->SetAll(shared_state2_in, |
| 362 arbitrary_rect1, | 366 arbitrary_rect1, |
| 363 arbitrary_rect2_inside_rect1, | 367 arbitrary_rect2_inside_rect1, |
| 364 arbitrary_rect1_inside_rect1, | 368 arbitrary_rect1_inside_rect1, |
| 365 arbitrary_bool1, | 369 arbitrary_bool1, |
| 366 arbitrary_id, | 370 arbitrary_id, |
| 367 arbitrary_bool2, | 371 arbitrary_bool2, |
| 368 arbitrary_resourceid2, | 372 arbitrary_resourceid2, |
| 369 arbitrary_rect1, | 373 arbitrary_rect1, |
| 370 arbitrary_rectf1, | 374 arbitrary_rectf1, |
| 371 arbitrary_filters1, | 375 arbitrary_filters1, |
| 372 arbitrary_filters2); | 376 arbitrary_filters2); |
| 373 scoped_ptr<RenderPassDrawQuad> renderpass_cmp = renderpass_in->Copy( | 377 RenderPassDrawQuad* renderpass_cmp = |
| 374 renderpass_in->shared_quad_state, renderpass_in->render_pass_id); | 378 pass_cmp->CopyFromAndAppendDrawQuad<RenderPassDrawQuad>(renderpass_in); |
| 379 renderpass_cmp->shared_quad_state = renderpass_in->shared_quad_state; |
| 380 renderpass_cmp->render_pass_id = renderpass_in->render_pass_id; |
| 375 | 381 |
| 376 SharedQuadState* shared_state3_in = pass_in->CreateAndAppendSharedQuadState(); | 382 SharedQuadState* shared_state3_in = pass_in->CreateAndAppendSharedQuadState(); |
| 377 shared_state3_in->SetAll(arbitrary_matrix, | 383 shared_state3_in->SetAll(arbitrary_matrix, |
| 378 arbitrary_size3, | 384 arbitrary_size3, |
| 379 arbitrary_rect3, | 385 arbitrary_rect3, |
| 380 arbitrary_rect1, | 386 arbitrary_rect1, |
| 381 arbitrary_bool1, | 387 arbitrary_bool1, |
| 382 arbitrary_float3, | 388 arbitrary_float3, |
| 383 arbitrary_blend_mode3, | 389 arbitrary_blend_mode3, |
| 384 arbitrary_context_id3); | 390 arbitrary_context_id3); |
| 385 SharedQuadState* shared_state3_cmp = | 391 SharedQuadState* shared_state3_cmp = |
| 386 pass_cmp->CreateAndAppendSharedQuadState(); | 392 pass_cmp->CreateAndAppendSharedQuadState(); |
| 387 shared_state3_cmp->CopyFrom(shared_state3_in); | 393 shared_state3_cmp->CopyFrom(shared_state3_in); |
| 388 | 394 |
| 389 scoped_ptr<SolidColorDrawQuad> solidcolor_in = | 395 SolidColorDrawQuad* solidcolor_in = |
| 390 SolidColorDrawQuad::Create(); | 396 pass_in->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 391 solidcolor_in->SetAll(shared_state3_in, | 397 solidcolor_in->SetAll(shared_state3_in, |
| 392 arbitrary_rect3, | 398 arbitrary_rect3, |
| 393 arbitrary_rect1_inside_rect3, | 399 arbitrary_rect1_inside_rect3, |
| 394 arbitrary_rect2_inside_rect3, | 400 arbitrary_rect2_inside_rect3, |
| 395 arbitrary_bool1, | 401 arbitrary_bool1, |
| 396 arbitrary_color, | 402 arbitrary_color, |
| 397 arbitrary_bool2); | 403 arbitrary_bool2); |
| 398 scoped_ptr<DrawQuad> solidcolor_cmp = solidcolor_in->Copy( | 404 SolidColorDrawQuad* solidcolor_cmp = |
| 399 solidcolor_in->shared_quad_state); | 405 pass_cmp->CopyFromAndAppendDrawQuad<SolidColorDrawQuad>(solidcolor_in); |
| 406 solidcolor_cmp->shared_quad_state = solidcolor_in->shared_quad_state; |
| 400 | 407 |
| 401 scoped_ptr<StreamVideoDrawQuad> streamvideo_in = | 408 StreamVideoDrawQuad* streamvideo_in = |
| 402 StreamVideoDrawQuad::Create(); | 409 pass_in->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); |
| 403 streamvideo_in->SetAll(shared_state3_in, | 410 streamvideo_in->SetAll(shared_state3_in, |
| 404 arbitrary_rect2, | 411 arbitrary_rect2, |
| 405 arbitrary_rect2_inside_rect2, | 412 arbitrary_rect2_inside_rect2, |
| 406 arbitrary_rect1_inside_rect2, | 413 arbitrary_rect1_inside_rect2, |
| 407 arbitrary_bool1, | 414 arbitrary_bool1, |
| 408 arbitrary_resourceid2, | 415 arbitrary_resourceid2, |
| 409 arbitrary_matrix); | 416 arbitrary_matrix); |
| 410 scoped_ptr<DrawQuad> streamvideo_cmp = streamvideo_in->Copy( | 417 StreamVideoDrawQuad* streamvideo_cmp = |
| 411 streamvideo_in->shared_quad_state); | 418 pass_cmp->CopyFromAndAppendDrawQuad<StreamVideoDrawQuad>(streamvideo_in); |
| 419 streamvideo_cmp->shared_quad_state = streamvideo_in->shared_quad_state; |
| 412 | 420 |
| 413 cc::SurfaceId arbitrary_surface_id(3); | 421 cc::SurfaceId arbitrary_surface_id(3); |
| 414 scoped_ptr<SurfaceDrawQuad> surface_in = SurfaceDrawQuad::Create(); | 422 SurfaceDrawQuad* surface_in = |
| 423 pass_in->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
| 415 surface_in->SetAll(shared_state3_in, | 424 surface_in->SetAll(shared_state3_in, |
| 416 arbitrary_rect2, | 425 arbitrary_rect2, |
| 417 arbitrary_rect2_inside_rect2, | 426 arbitrary_rect2_inside_rect2, |
| 418 arbitrary_rect1_inside_rect2, | 427 arbitrary_rect1_inside_rect2, |
| 419 arbitrary_bool1, | 428 arbitrary_bool1, |
| 420 arbitrary_surface_id); | 429 arbitrary_surface_id); |
| 421 scoped_ptr<DrawQuad> surface_cmp = surface_in->Copy( | 430 SurfaceDrawQuad* surface_cmp = |
| 422 surface_in->shared_quad_state); | 431 pass_cmp->CopyFromAndAppendDrawQuad<SurfaceDrawQuad>(surface_in); |
| 432 surface_cmp->shared_quad_state = surface_in->shared_quad_state; |
| 423 | 433 |
| 424 scoped_ptr<TextureDrawQuad> texture_in = TextureDrawQuad::Create(); | 434 TextureDrawQuad* texture_in = |
| 435 pass_in->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| 425 texture_in->SetAll(shared_state3_in, | 436 texture_in->SetAll(shared_state3_in, |
| 426 arbitrary_rect2, | 437 arbitrary_rect2, |
| 427 arbitrary_rect2_inside_rect2, | 438 arbitrary_rect2_inside_rect2, |
| 428 arbitrary_rect1_inside_rect2, | 439 arbitrary_rect1_inside_rect2, |
| 429 arbitrary_bool1, | 440 arbitrary_bool1, |
| 430 arbitrary_resourceid1, | 441 arbitrary_resourceid1, |
| 431 arbitrary_bool2, | 442 arbitrary_bool2, |
| 432 arbitrary_pointf1, | 443 arbitrary_pointf1, |
| 433 arbitrary_pointf2, | 444 arbitrary_pointf2, |
| 434 arbitrary_color, | 445 arbitrary_color, |
| 435 arbitrary_float_array, | 446 arbitrary_float_array, |
| 436 arbitrary_bool3); | 447 arbitrary_bool3); |
| 437 scoped_ptr<DrawQuad> texture_cmp = texture_in->Copy( | 448 TextureDrawQuad* texture_cmp = |
| 438 texture_in->shared_quad_state); | 449 pass_cmp->CopyFromAndAppendDrawQuad<TextureDrawQuad>(texture_in); |
| 450 texture_cmp->shared_quad_state = texture_in->shared_quad_state; |
| 439 | 451 |
| 440 scoped_ptr<TileDrawQuad> tile_in = TileDrawQuad::Create(); | 452 TileDrawQuad* tile_in = pass_in->CreateAndAppendDrawQuad<TileDrawQuad>(); |
| 441 tile_in->SetAll(shared_state3_in, | 453 tile_in->SetAll(shared_state3_in, |
| 442 arbitrary_rect2, | 454 arbitrary_rect2, |
| 443 arbitrary_rect2_inside_rect2, | 455 arbitrary_rect2_inside_rect2, |
| 444 arbitrary_rect1_inside_rect2, | 456 arbitrary_rect1_inside_rect2, |
| 445 arbitrary_bool1, | 457 arbitrary_bool1, |
| 446 arbitrary_resourceid3, | 458 arbitrary_resourceid3, |
| 447 arbitrary_rectf1, | 459 arbitrary_rectf1, |
| 448 arbitrary_size1, | 460 arbitrary_size1, |
| 449 arbitrary_bool2); | 461 arbitrary_bool2); |
| 450 scoped_ptr<DrawQuad> tile_cmp = tile_in->Copy( | 462 TileDrawQuad* tile_cmp = |
| 451 tile_in->shared_quad_state); | 463 pass_cmp->CopyFromAndAppendDrawQuad<TileDrawQuad>(tile_in); |
| 464 tile_cmp->shared_quad_state = tile_in->shared_quad_state; |
| 452 | 465 |
| 453 scoped_ptr<YUVVideoDrawQuad> yuvvideo_in = | 466 YUVVideoDrawQuad* yuvvideo_in = |
| 454 YUVVideoDrawQuad::Create(); | 467 pass_in->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
| 455 yuvvideo_in->SetAll(shared_state3_in, | 468 yuvvideo_in->SetAll(shared_state3_in, |
| 456 arbitrary_rect1, | 469 arbitrary_rect1, |
| 457 arbitrary_rect2_inside_rect1, | 470 arbitrary_rect2_inside_rect1, |
| 458 arbitrary_rect1_inside_rect1, | 471 arbitrary_rect1_inside_rect1, |
| 459 arbitrary_bool1, | 472 arbitrary_bool1, |
| 460 arbitrary_rectf1, | 473 arbitrary_rectf1, |
| 461 arbitrary_resourceid1, | 474 arbitrary_resourceid1, |
| 462 arbitrary_resourceid2, | 475 arbitrary_resourceid2, |
| 463 arbitrary_resourceid3, | 476 arbitrary_resourceid3, |
| 464 arbitrary_resourceid4, | 477 arbitrary_resourceid4, |
| 465 arbitrary_color_space); | 478 arbitrary_color_space); |
| 466 scoped_ptr<DrawQuad> yuvvideo_cmp = yuvvideo_in->Copy( | 479 YUVVideoDrawQuad* yuvvideo_cmp = |
| 467 yuvvideo_in->shared_quad_state); | 480 pass_cmp->CopyFromAndAppendDrawQuad<YUVVideoDrawQuad>(yuvvideo_in); |
| 468 | 481 yuvvideo_cmp->shared_quad_state = yuvvideo_in->shared_quad_state; |
| 469 pass_in->quad_list.push_back(checkerboard_in.PassAs<DrawQuad>()); | |
| 470 pass_in->quad_list.push_back(debugborder_in.PassAs<DrawQuad>()); | |
| 471 pass_in->quad_list.push_back(iosurface_in.PassAs<DrawQuad>()); | |
| 472 pass_in->quad_list.push_back(renderpass_in.PassAs<DrawQuad>()); | |
| 473 pass_in->quad_list.push_back(solidcolor_in.PassAs<DrawQuad>()); | |
| 474 pass_in->quad_list.push_back(streamvideo_in.PassAs<DrawQuad>()); | |
| 475 pass_in->quad_list.push_back(surface_in.PassAs<DrawQuad>()); | |
| 476 pass_in->quad_list.push_back(texture_in.PassAs<DrawQuad>()); | |
| 477 pass_in->quad_list.push_back(tile_in.PassAs<DrawQuad>()); | |
| 478 pass_in->quad_list.push_back(yuvvideo_in.PassAs<DrawQuad>()); | |
| 479 | |
| 480 | |
| 481 pass_cmp->quad_list.push_back(checkerboard_cmp.PassAs<DrawQuad>()); | |
| 482 pass_cmp->quad_list.push_back(debugborder_cmp.PassAs<DrawQuad>()); | |
| 483 pass_cmp->quad_list.push_back(iosurface_cmp.PassAs<DrawQuad>()); | |
| 484 pass_cmp->quad_list.push_back(renderpass_cmp.PassAs<DrawQuad>()); | |
| 485 pass_cmp->quad_list.push_back(solidcolor_cmp.PassAs<DrawQuad>()); | |
| 486 pass_cmp->quad_list.push_back(streamvideo_cmp.PassAs<DrawQuad>()); | |
| 487 pass_cmp->quad_list.push_back(surface_cmp.PassAs<DrawQuad>()); | |
| 488 pass_cmp->quad_list.push_back(texture_cmp.PassAs<DrawQuad>()); | |
| 489 pass_cmp->quad_list.push_back(tile_cmp.PassAs<DrawQuad>()); | |
| 490 pass_cmp->quad_list.push_back(yuvvideo_cmp.PassAs<DrawQuad>()); | |
| 491 | 482 |
| 492 // Make sure the in and cmp RenderPasses match. | 483 // Make sure the in and cmp RenderPasses match. |
| 493 Compare(pass_cmp.get(), pass_in.get()); | 484 Compare(pass_cmp.get(), pass_in.get()); |
| 494 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size()); | 485 ASSERT_EQ(3u, pass_in->shared_quad_state_list.size()); |
| 495 ASSERT_EQ(10u, pass_in->quad_list.size()); | 486 ASSERT_EQ(10u, pass_in->quad_list.size()); |
| 496 for (size_t i = 0; i < 3; ++i) { | 487 for (size_t i = 0; i < 3; ++i) { |
| 497 Compare(pass_cmp->shared_quad_state_list[i], | 488 Compare(pass_cmp->shared_quad_state_list[i], |
| 498 pass_in->shared_quad_state_list[i]); | 489 pass_in->shared_quad_state_list[i]); |
| 499 } | 490 } |
| 500 for (size_t i = 0; i < pass_in->quad_list.size(); ++i) | 491 for (size_t i = 0; i < pass_in->quad_list.size(); ++i) |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 pass_cmp->quad_list[i]->shared_quad_state == | 527 pass_cmp->quad_list[i]->shared_quad_state == |
| 537 pass_cmp->quad_list[i - 1]->shared_quad_state; | 528 pass_cmp->quad_list[i - 1]->shared_quad_state; |
| 538 bool same_shared_quad_state_out = | 529 bool same_shared_quad_state_out = |
| 539 pass_out->quad_list[i]->shared_quad_state == | 530 pass_out->quad_list[i]->shared_quad_state == |
| 540 pass_out->quad_list[i - 1]->shared_quad_state; | 531 pass_out->quad_list[i - 1]->shared_quad_state; |
| 541 EXPECT_EQ(same_shared_quad_state_cmp, same_shared_quad_state_out); | 532 EXPECT_EQ(same_shared_quad_state_cmp, same_shared_quad_state_out); |
| 542 } | 533 } |
| 543 } | 534 } |
| 544 | 535 |
| 545 TEST_F(CCMessagesTest, UnusedSharedQuadStates) { | 536 TEST_F(CCMessagesTest, UnusedSharedQuadStates) { |
| 546 scoped_ptr<CheckerboardDrawQuad> quad; | |
| 547 | |
| 548 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); | 537 scoped_ptr<RenderPass> pass_in = RenderPass::Create(); |
| 549 pass_in->SetAll(RenderPass::Id(1, 1), | 538 pass_in->SetAll(RenderPass::Id(1, 1), |
| 550 gfx::Rect(100, 100), | 539 gfx::Rect(100, 100), |
| 551 gfx::Rect(), | 540 gfx::Rect(), |
| 552 gfx::Transform(), | 541 gfx::Transform(), |
| 553 false); | 542 false); |
| 554 | 543 |
| 555 // The first SharedQuadState is used. | 544 // The first SharedQuadState is used. |
| 556 SharedQuadState* shared_state1_in = pass_in->CreateAndAppendSharedQuadState(); | 545 SharedQuadState* shared_state1_in = pass_in->CreateAndAppendSharedQuadState(); |
| 557 shared_state1_in->SetAll(gfx::Transform(), | 546 shared_state1_in->SetAll(gfx::Transform(), |
| 558 gfx::Size(1, 1), | 547 gfx::Size(1, 1), |
| 559 gfx::Rect(), | 548 gfx::Rect(), |
| 560 gfx::Rect(), | 549 gfx::Rect(), |
| 561 false, | 550 false, |
| 562 1.f, | 551 1.f, |
| 563 SkXfermode::kSrcOver_Mode, | 552 SkXfermode::kSrcOver_Mode, |
| 564 0); | 553 0); |
| 565 | 554 |
| 566 quad = CheckerboardDrawQuad::Create(); | 555 CheckerboardDrawQuad* quad1 = |
| 567 quad->SetAll(shared_state1_in, | 556 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); |
| 568 gfx::Rect(10, 10), | 557 quad1->SetAll(shared_state1_in, |
| 569 gfx::Rect(10, 10), | 558 gfx::Rect(10, 10), |
| 570 gfx::Rect(10, 10), | 559 gfx::Rect(10, 10), |
| 571 false, | 560 gfx::Rect(10, 10), |
| 572 SK_ColorRED); | 561 false, |
| 573 pass_in->quad_list.push_back(quad.PassAs<DrawQuad>()); | 562 SK_ColorRED); |
| 574 | 563 |
| 575 // The second and third SharedQuadStates are not used. | 564 // The second and third SharedQuadStates are not used. |
| 576 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); | 565 SharedQuadState* shared_state2_in = pass_in->CreateAndAppendSharedQuadState(); |
| 577 shared_state2_in->SetAll(gfx::Transform(), | 566 shared_state2_in->SetAll(gfx::Transform(), |
| 578 gfx::Size(2, 2), | 567 gfx::Size(2, 2), |
| 579 gfx::Rect(), | 568 gfx::Rect(), |
| 580 gfx::Rect(), | 569 gfx::Rect(), |
| 581 false, | 570 false, |
| 582 1.f, | 571 1.f, |
| 583 SkXfermode::kSrcOver_Mode, | 572 SkXfermode::kSrcOver_Mode, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 597 SharedQuadState* shared_state4_in = pass_in->CreateAndAppendSharedQuadState(); | 586 SharedQuadState* shared_state4_in = pass_in->CreateAndAppendSharedQuadState(); |
| 598 shared_state4_in->SetAll(gfx::Transform(), | 587 shared_state4_in->SetAll(gfx::Transform(), |
| 599 gfx::Size(4, 4), | 588 gfx::Size(4, 4), |
| 600 gfx::Rect(), | 589 gfx::Rect(), |
| 601 gfx::Rect(), | 590 gfx::Rect(), |
| 602 false, | 591 false, |
| 603 1.f, | 592 1.f, |
| 604 SkXfermode::kSrcOver_Mode, | 593 SkXfermode::kSrcOver_Mode, |
| 605 0); | 594 0); |
| 606 | 595 |
| 607 quad = CheckerboardDrawQuad::Create(); | 596 CheckerboardDrawQuad* quad2 = |
| 608 quad->SetAll(shared_state4_in, | 597 pass_in->CreateAndAppendDrawQuad<CheckerboardDrawQuad>(); |
| 609 gfx::Rect(10, 10), | 598 quad2->SetAll(shared_state4_in, |
| 610 gfx::Rect(10, 10), | 599 gfx::Rect(10, 10), |
| 611 gfx::Rect(10, 10), | 600 gfx::Rect(10, 10), |
| 612 false, | 601 gfx::Rect(10, 10), |
| 613 SK_ColorRED); | 602 false, |
| 614 pass_in->quad_list.push_back(quad.PassAs<DrawQuad>()); | 603 SK_ColorRED); |
| 615 | 604 |
| 616 // The fifth is not used again. | 605 // The fifth is not used again. |
| 617 SharedQuadState* shared_state5_in = pass_in->CreateAndAppendSharedQuadState(); | 606 SharedQuadState* shared_state5_in = pass_in->CreateAndAppendSharedQuadState(); |
| 618 shared_state5_in->SetAll(gfx::Transform(), | 607 shared_state5_in->SetAll(gfx::Transform(), |
| 619 gfx::Size(5, 5), | 608 gfx::Size(5, 5), |
| 620 gfx::Rect(), | 609 gfx::Rect(), |
| 621 gfx::Rect(), | 610 gfx::Rect(), |
| 622 false, | 611 false, |
| 623 1.f, | 612 1.f, |
| 624 SkXfermode::kSrcOver_Mode, | 613 SkXfermode::kSrcOver_Mode, |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 SoftwareFrameData frame_out; | 809 SoftwareFrameData frame_out; |
| 821 PickleIterator iter(msg); | 810 PickleIterator iter(msg); |
| 822 EXPECT_EQ( | 811 EXPECT_EQ( |
| 823 expect_read, | 812 expect_read, |
| 824 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); | 813 IPC::ParamTraits<SoftwareFrameData>::Read(&msg, &iter, &frame_out)); |
| 825 } | 814 } |
| 826 } | 815 } |
| 827 | 816 |
| 828 } // namespace | 817 } // namespace |
| 829 } // namespace content | 818 } // namespace content |
| OLD | NEW |