OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/thread_task_runner_handle.h" | 5 #include "base/thread_task_runner_handle.h" |
6 #include "cc/resources/resource_pool.h" | 6 #include "cc/resources/resource_pool.h" |
7 #include "cc/test/begin_frame_args_test.h" | 7 #include "cc/test/begin_frame_args_test.h" |
8 #include "cc/test/fake_impl_proxy.h" | 8 #include "cc/test/fake_impl_proxy.h" |
9 #include "cc/test/fake_layer_tree_host_impl.h" | 9 #include "cc/test/fake_layer_tree_host_impl.h" |
10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 pending_layer_->AddChild(pending_child.Pass()); | 618 pending_layer_->AddChild(pending_child.Pass()); |
619 | 619 |
620 // Set a small viewport, so we have soon and eventually tiles. | 620 // Set a small viewport, so we have soon and eventually tiles. |
621 host_impl_.SetViewportSize(gfx::Size(200, 200)); | 621 host_impl_.SetViewportSize(gfx::Size(200, 200)); |
622 time_ticks += base::TimeDelta::FromMilliseconds(1); | 622 time_ticks += base::TimeDelta::FromMilliseconds(1); |
623 host_impl_.SetCurrentBeginFrameArgs( | 623 host_impl_.SetCurrentBeginFrameArgs( |
624 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); | 624 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); |
625 bool update_lcd_text = false; | 625 bool update_lcd_text = false; |
626 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); | 626 host_impl_.pending_tree()->UpdateDrawProperties(update_lcd_text); |
627 | 627 |
628 host_impl_.SetRequiresHighResToDraw(); | 628 host_impl_.SetRequiresHighResToDraw(true); |
629 scoped_ptr<RasterTilePriorityQueue> queue(host_impl_.BuildRasterQueue( | 629 scoped_ptr<RasterTilePriorityQueue> queue(host_impl_.BuildRasterQueue( |
630 SMOOTHNESS_TAKES_PRIORITY, RasterTilePriorityQueue::Type::ALL)); | 630 SMOOTHNESS_TAKES_PRIORITY, RasterTilePriorityQueue::Type::ALL)); |
631 EXPECT_FALSE(queue->IsEmpty()); | 631 EXPECT_FALSE(queue->IsEmpty()); |
632 | 632 |
633 // Get all the tiles that are NOW or SOON and make sure they are ready to | 633 // Get all the tiles that are NOW or SOON and make sure they are ready to |
634 // draw. | 634 // draw. |
635 std::vector<Tile*> all_tiles; | 635 std::vector<Tile*> all_tiles; |
636 while (!queue->IsEmpty()) { | 636 while (!queue->IsEmpty()) { |
637 PrioritizedTile prioritized_tile = queue->Top(); | 637 PrioritizedTile prioritized_tile = queue->Top(); |
638 if (prioritized_tile.priority().priority_bin >= TilePriority::EVENTUALLY) | 638 if (prioritized_tile.priority().priority_bin >= TilePriority::EVENTUALLY) |
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1419 RGBA_8888); | 1419 RGBA_8888); |
1420 | 1420 |
1421 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); | 1421 host_impl_.tile_manager()->CheckIfMoreTilesNeedToBePreparedForTesting(); |
1422 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); | 1422 EXPECT_FALSE(host_impl_.is_likely_to_require_a_draw()); |
1423 | 1423 |
1424 host_impl_.resource_pool()->ReleaseResource(resource.Pass()); | 1424 host_impl_.resource_pool()->ReleaseResource(resource.Pass()); |
1425 } | 1425 } |
1426 | 1426 |
1427 } // namespace | 1427 } // namespace |
1428 } // namespace cc | 1428 } // namespace cc |
OLD | NEW |