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" |
10 #include "cc/test/fake_impl_proxy.h" | 11 #include "cc/test/fake_impl_proxy.h" |
11 #include "cc/test/fake_layer_tree_host_impl.h" | 12 #include "cc/test/fake_layer_tree_host_impl.h" |
12 #include "cc/test/fake_output_surface.h" | 13 #include "cc/test/fake_output_surface.h" |
13 #include "cc/test/fake_picture_pile_impl.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 switch (which_tree) { | 57 switch (which_tree) { |
58 case ACTIVE_TREE: | 58 case ACTIVE_TREE: |
59 tree = host_impl_.active_tree(); | 59 tree = host_impl_.active_tree(); |
60 break; | 60 break; |
61 case PENDING_TREE: | 61 case PENDING_TREE: |
62 tree = host_impl_.pending_tree(); | 62 tree = host_impl_.pending_tree(); |
63 break; | 63 break; |
64 } | 64 } |
65 TestablePictureImageLayerImpl* layer = | 65 TestablePictureImageLayerImpl* layer = |
66 new TestablePictureImageLayerImpl(tree, id); | 66 new TestablePictureImageLayerImpl(tree, id); |
67 layer->raster_source_ = FakePicturePileImpl::CreateInfiniteFilledPile(); | 67 layer->raster_source_ = FakeDisplayListRasterSource::CreateInfiniteFilled(); |
68 layer->SetBounds(layer->raster_source_->GetSize()); | 68 layer->SetBounds(layer->raster_source_->GetSize()); |
69 return make_scoped_ptr(layer); | 69 return make_scoped_ptr(layer); |
70 } | 70 } |
71 | 71 |
72 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer, | 72 void SetupDrawPropertiesAndUpdateTiles(TestablePictureImageLayerImpl* layer, |
73 float ideal_contents_scale, | 73 float ideal_contents_scale, |
74 float device_scale_factor, | 74 float device_scale_factor, |
75 float page_scale_factor, | 75 float page_scale_factor, |
76 float maximum_animation_contents_scale, | 76 float maximum_animation_contents_scale, |
77 bool animating_transform_to_screen, | 77 bool animating_transform_to_screen, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 active_layer->DidDraw(nullptr); | 157 active_layer->DidDraw(nullptr); |
158 | 158 |
159 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); | 159 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); |
160 | 160 |
161 // Tiles are ready at correct scale, so should not set had_incomplete_tile. | 161 // Tiles are ready at correct scale, so should not set had_incomplete_tile. |
162 EXPECT_EQ(0, data.num_incomplete_tiles); | 162 EXPECT_EQ(0, data.num_incomplete_tiles); |
163 } | 163 } |
164 | 164 |
165 } // namespace | 165 } // namespace |
166 } // namespace cc | 166 } // namespace cc |
OLD | NEW |