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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 396 |
397 // Root pass is green. | 397 // Root pass is green. |
398 RenderPassId root_clear_pass_id(1, 0); | 398 RenderPassId root_clear_pass_id(1, 0); |
399 TestRenderPass* root_clear_pass = AddRenderPass( | 399 TestRenderPass* root_clear_pass = AddRenderPass( |
400 &list, root_clear_pass_id, device_viewport_rect, gfx::Transform()); | 400 &list, root_clear_pass_id, device_viewport_rect, gfx::Transform()); |
401 AddRenderPassQuad(root_clear_pass, smaller_pass); | 401 AddRenderPassQuad(root_clear_pass, smaller_pass); |
402 AddQuad(root_clear_pass, device_viewport_rect, SK_ColorGREEN); | 402 AddQuad(root_clear_pass, device_viewport_rect, SK_ColorGREEN); |
403 | 403 |
404 // Interior pass quad has smaller visible rect. | 404 // Interior pass quad has smaller visible rect. |
405 gfx::Rect interior_visible_rect(30, 30, 40, 40); | 405 gfx::Rect interior_visible_rect(30, 30, 40, 40); |
406 root_clear_pass->quad_list[0]->visible_rect = interior_visible_rect; | 406 root_clear_pass->quad_list.front()->visible_rect = interior_visible_rect; |
407 | 407 |
408 renderer()->DecideRenderPassAllocationsForFrame(list); | 408 renderer()->DecideRenderPassAllocationsForFrame(list); |
409 | 409 |
410 scoped_ptr<SkBitmap> output = | 410 scoped_ptr<SkBitmap> output = |
411 DrawAndCopyOutput(&list, device_scale_factor, device_viewport_rect); | 411 DrawAndCopyOutput(&list, device_scale_factor, device_viewport_rect); |
412 EXPECT_EQ(device_viewport_rect.width(), output->info().fWidth); | 412 EXPECT_EQ(device_viewport_rect.width(), output->info().fWidth); |
413 EXPECT_EQ(device_viewport_rect.width(), output->info().fHeight); | 413 EXPECT_EQ(device_viewport_rect.width(), output->info().fHeight); |
414 | 414 |
415 EXPECT_EQ(SK_ColorGREEN, output->getColor(0, 0)); | 415 EXPECT_EQ(SK_ColorGREEN, output->getColor(0, 0)); |
416 EXPECT_EQ(SK_ColorGREEN, | 416 EXPECT_EQ(SK_ColorGREEN, |
(...skipping 10 matching lines...) Expand all Loading... |
427 EXPECT_EQ( | 427 EXPECT_EQ( |
428 SK_ColorMAGENTA, | 428 SK_ColorMAGENTA, |
429 output->getColor(interior_visible_rect.x(), interior_visible_rect.y())); | 429 output->getColor(interior_visible_rect.x(), interior_visible_rect.y())); |
430 EXPECT_EQ(SK_ColorMAGENTA, | 430 EXPECT_EQ(SK_ColorMAGENTA, |
431 output->getColor(interior_visible_rect.right() - 1, | 431 output->getColor(interior_visible_rect.right() - 1, |
432 interior_visible_rect.bottom() - 1)); | 432 interior_visible_rect.bottom() - 1)); |
433 } | 433 } |
434 | 434 |
435 } // namespace | 435 } // namespace |
436 } // namespace cc | 436 } // namespace cc |
OLD | NEW |