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_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2923 EXPECT_FALSE(tile->IsReadyToDraw()); | 2923 EXPECT_FALSE(tile->IsReadyToDraw()); |
2924 queue->Pop(); | 2924 queue->Pop(); |
2925 } | 2925 } |
2926 | 2926 |
2927 queue.reset(new TilingSetRasterQueueRequired( | 2927 queue.reset(new TilingSetRasterQueueRequired( |
2928 active_layer_->picture_layer_tiling_set(), | 2928 active_layer_->picture_layer_tiling_set(), |
2929 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION)); | 2929 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION)); |
2930 EXPECT_TRUE(queue->IsEmpty()); | 2930 EXPECT_TRUE(queue->IsEmpty()); |
2931 } | 2931 } |
2932 | 2932 |
| 2933 TEST_F(PictureLayerImplTest, TilingSetRasterQueueRequiredNoHighRes) { |
| 2934 scoped_refptr<FakePicturePileImpl> pending_pile = |
| 2935 FakePicturePileImpl::CreateEmptyPile(gfx::Size(256, 256), |
| 2936 gfx::Size(1024, 1024)); |
| 2937 pending_pile->set_is_solid_color(true); |
| 2938 |
| 2939 SetupPendingTree(pending_pile); |
| 2940 EXPECT_FALSE( |
| 2941 pending_layer_->picture_layer_tiling_set()->FindTilingWithResolution( |
| 2942 HIGH_RESOLUTION)); |
| 2943 |
| 2944 scoped_ptr<TilingSetRasterQueue> queue(new TilingSetRasterQueueRequired( |
| 2945 pending_layer_->picture_layer_tiling_set(), |
| 2946 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION)); |
| 2947 EXPECT_TRUE(queue->IsEmpty()); |
| 2948 } |
| 2949 |
2933 TEST_F(PictureLayerImplTest, TilingSetEvictionQueue) { | 2950 TEST_F(PictureLayerImplTest, TilingSetEvictionQueue) { |
2934 gfx::Size tile_size(100, 100); | 2951 gfx::Size tile_size(100, 100); |
2935 gfx::Size layer_bounds(1000, 1000); | 2952 gfx::Size layer_bounds(1000, 1000); |
2936 float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; | 2953 float low_res_factor = host_impl_.settings().low_res_contents_scale_factor; |
2937 | 2954 |
2938 host_impl_.SetViewportSize(gfx::Size(500, 500)); | 2955 host_impl_.SetViewportSize(gfx::Size(500, 500)); |
2939 | 2956 |
2940 scoped_refptr<FakePicturePileImpl> pending_pile = | 2957 scoped_refptr<FakePicturePileImpl> pending_pile = |
2941 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); | 2958 FakePicturePileImpl::CreateFilledPile(tile_size, layer_bounds); |
2942 | 2959 |
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4807 result = layer->CalculateTileSize(gfx::Size(447, 400)); | 4824 result = layer->CalculateTileSize(gfx::Size(447, 400)); |
4808 EXPECT_EQ(result.width(), 448); | 4825 EXPECT_EQ(result.width(), 448); |
4809 EXPECT_EQ(result.height(), 448); | 4826 EXPECT_EQ(result.height(), 448); |
4810 result = layer->CalculateTileSize(gfx::Size(500, 499)); | 4827 result = layer->CalculateTileSize(gfx::Size(500, 499)); |
4811 EXPECT_EQ(result.width(), 512); | 4828 EXPECT_EQ(result.width(), 512); |
4812 EXPECT_EQ(result.height(), 500 + 2); | 4829 EXPECT_EQ(result.height(), 500 + 2); |
4813 } | 4830 } |
4814 | 4831 |
4815 } // namespace | 4832 } // namespace |
4816 } // namespace cc | 4833 } // namespace cc |
OLD | NEW |