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