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 "cc/layers/picture_image_layer_impl.h" | 5 #include "cc/layers/picture_image_layer_impl.h" |
6 | 6 |
7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
8 #include "cc/layers/append_quads_data.h" | 8 #include "cc/layers/append_quads_data.h" |
9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
10 #include "cc/test/fake_display_list_raster_source.h" | |
11 #include "cc/test/fake_impl_task_runner_provider.h" | 10 #include "cc/test/fake_impl_task_runner_provider.h" |
12 #include "cc/test/fake_layer_tree_host_impl.h" | 11 #include "cc/test/fake_layer_tree_host_impl.h" |
13 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
| 13 #include "cc/test/fake_raster_source.h" |
14 #include "cc/test/test_shared_bitmap_manager.h" | 14 #include "cc/test/test_shared_bitmap_manager.h" |
15 #include "cc/test/test_task_graph_runner.h" | 15 #include "cc/test/test_task_graph_runner.h" |
16 #include "cc/tiles/tile_priority.h" | 16 #include "cc/tiles/tile_priority.h" |
17 #include "cc/trees/layer_tree_impl.h" | 17 #include "cc/trees/layer_tree_impl.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 namespace { | 21 namespace { |
22 | 22 |
23 class TestablePictureImageLayerImpl : public PictureImageLayerImpl { | 23 class TestablePictureImageLayerImpl : public PictureImageLayerImpl { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 switch (which_tree) { | 64 switch (which_tree) { |
65 case ACTIVE_TREE: | 65 case ACTIVE_TREE: |
66 tree = host_impl_.active_tree(); | 66 tree = host_impl_.active_tree(); |
67 break; | 67 break; |
68 case PENDING_TREE: | 68 case PENDING_TREE: |
69 tree = host_impl_.pending_tree(); | 69 tree = host_impl_.pending_tree(); |
70 break; | 70 break; |
71 } | 71 } |
72 TestablePictureImageLayerImpl* layer = | 72 TestablePictureImageLayerImpl* layer = |
73 new TestablePictureImageLayerImpl(tree, id); | 73 new TestablePictureImageLayerImpl(tree, id); |
74 layer->raster_source_ = FakeDisplayListRasterSource::CreateInfiniteFilled(); | 74 layer->raster_source_ = FakeRasterSource::CreateInfiniteFilled(); |
75 layer->SetBounds(layer->raster_source_->GetSize()); | 75 layer->SetBounds(layer->raster_source_->GetSize()); |
76 return make_scoped_ptr(layer); | 76 return make_scoped_ptr(layer); |
77 } | 77 } |
78 | 78 |
79 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer, | 79 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer, |
80 float ideal_contents_scale, | 80 float ideal_contents_scale, |
81 float device_scale_factor, | 81 float device_scale_factor, |
82 float page_scale_factor, | 82 float page_scale_factor, |
83 float maximum_animation_contents_scale, | 83 float maximum_animation_contents_scale, |
84 bool animating_transform_to_screen, | 84 bool animating_transform_to_screen, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 active_layer->DidDraw(nullptr); | 168 active_layer->DidDraw(nullptr); |
169 | 169 |
170 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); | 170 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); |
171 | 171 |
172 // Tiles are ready at correct scale, so should not set had_incomplete_tile. | 172 // Tiles are ready at correct scale, so should not set had_incomplete_tile. |
173 EXPECT_EQ(0, data.num_incomplete_tiles); | 173 EXPECT_EQ(0, data.num_incomplete_tiles); |
174 } | 174 } |
175 | 175 |
176 } // namespace | 176 } // namespace |
177 } // namespace cc | 177 } // namespace cc |
OLD | NEW |