OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/output/software_renderer.h" | 5 #include "cc/output/software_renderer.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "cc/output/compositor_frame_metadata.h" | 8 #include "cc/output/compositor_frame_metadata.h" |
9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 400 |
401 // Root pass is green. | 401 // Root pass is green. |
402 RenderPassId root_clear_pass_id(1, 0); | 402 RenderPassId root_clear_pass_id(1, 0); |
403 TestRenderPass* root_clear_pass = AddRenderPass( | 403 TestRenderPass* root_clear_pass = AddRenderPass( |
404 &list, root_clear_pass_id, device_viewport_rect, gfx::Transform()); | 404 &list, root_clear_pass_id, device_viewport_rect, gfx::Transform()); |
405 AddRenderPassQuad(root_clear_pass, smaller_pass); | 405 AddRenderPassQuad(root_clear_pass, smaller_pass); |
406 AddQuad(root_clear_pass, device_viewport_rect, SK_ColorGREEN); | 406 AddQuad(root_clear_pass, device_viewport_rect, SK_ColorGREEN); |
407 | 407 |
408 // Interior pass quad has smaller visible rect. | 408 // Interior pass quad has smaller visible rect. |
409 gfx::Rect interior_visible_rect(30, 30, 40, 40); | 409 gfx::Rect interior_visible_rect(30, 30, 40, 40); |
410 root_clear_pass->quad_list[0]->visible_rect = interior_visible_rect; | 410 root_clear_pass->quad_list.front()->visible_rect = interior_visible_rect; |
411 | 411 |
412 renderer()->DecideRenderPassAllocationsForFrame(list); | 412 renderer()->DecideRenderPassAllocationsForFrame(list); |
413 | 413 |
414 scoped_ptr<SkBitmap> output = | 414 scoped_ptr<SkBitmap> output = |
415 DrawAndCopyOutput(&list, device_scale_factor, device_viewport_rect); | 415 DrawAndCopyOutput(&list, device_scale_factor, device_viewport_rect); |
416 EXPECT_EQ(device_viewport_rect.width(), output->info().fWidth); | 416 EXPECT_EQ(device_viewport_rect.width(), output->info().fWidth); |
417 EXPECT_EQ(device_viewport_rect.width(), output->info().fHeight); | 417 EXPECT_EQ(device_viewport_rect.width(), output->info().fHeight); |
418 | 418 |
419 EXPECT_EQ(SK_ColorGREEN, output->getColor(0, 0)); | 419 EXPECT_EQ(SK_ColorGREEN, output->getColor(0, 0)); |
420 EXPECT_EQ(SK_ColorGREEN, | 420 EXPECT_EQ(SK_ColorGREEN, |
(...skipping 10 matching lines...) Expand all Loading... |
431 EXPECT_EQ( | 431 EXPECT_EQ( |
432 SK_ColorMAGENTA, | 432 SK_ColorMAGENTA, |
433 output->getColor(interior_visible_rect.x(), interior_visible_rect.y())); | 433 output->getColor(interior_visible_rect.x(), interior_visible_rect.y())); |
434 EXPECT_EQ(SK_ColorMAGENTA, | 434 EXPECT_EQ(SK_ColorMAGENTA, |
435 output->getColor(interior_visible_rect.right() - 1, | 435 output->getColor(interior_visible_rect.right() - 1, |
436 interior_visible_rect.bottom() - 1)); | 436 interior_visible_rect.bottom() - 1)); |
437 } | 437 } |
438 | 438 |
439 } // namespace | 439 } // namespace |
440 } // namespace cc | 440 } // namespace cc |
OLD | NEW |