| 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/tiles/picture_layer_tiling.h" | 5 #include "cc/tiles/picture_layer_tiling.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 static std::unique_ptr<TestablePictureLayerTiling> Create( | 48 static std::unique_ptr<TestablePictureLayerTiling> Create( |
| 49 WhichTree tree, | 49 WhichTree tree, |
| 50 float contents_scale, | 50 float contents_scale, |
| 51 scoped_refptr<RasterSource> raster_source, | 51 scoped_refptr<RasterSource> raster_source, |
| 52 PictureLayerTilingClient* client, | 52 PictureLayerTilingClient* client, |
| 53 const LayerTreeSettings& settings) { | 53 const LayerTreeSettings& settings) { |
| 54 return base::WrapUnique(new TestablePictureLayerTiling( | 54 return base::WrapUnique(new TestablePictureLayerTiling( |
| 55 tree, contents_scale, raster_source, client, | 55 tree, contents_scale, raster_source, client, |
| 56 settings.tiling_interest_area_padding, | 56 settings.tiling_interest_area_padding, |
| 57 settings.skewport_target_time_in_seconds, | 57 settings.skewport_target_time_in_seconds, |
| 58 settings.skewport_extrapolation_limit_in_screen_pixels)); | 58 settings.skewport_extrapolation_limit_in_screen_pixels, |
| 59 312.f, /* min_preraster_distance */ |
| 60 settings.max_preraster_distance_in_screen_pixels)); |
| 59 } | 61 } |
| 60 | 62 |
| 61 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 63 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
| 62 | 64 |
| 63 using PictureLayerTiling::RemoveTileAt; | 65 using PictureLayerTiling::RemoveTileAt; |
| 64 using PictureLayerTiling::RemoveTilesInRegion; | 66 using PictureLayerTiling::RemoveTilesInRegion; |
| 65 | 67 |
| 66 protected: | 68 protected: |
| 67 TestablePictureLayerTiling(WhichTree tree, | 69 TestablePictureLayerTiling(WhichTree tree, |
| 68 float contents_scale, | 70 float contents_scale, |
| 69 scoped_refptr<RasterSource> raster_source, | 71 scoped_refptr<RasterSource> raster_source, |
| 70 PictureLayerTilingClient* client, | 72 PictureLayerTilingClient* client, |
| 71 size_t tiling_interest_area_padding, | 73 size_t tiling_interest_area_padding, |
| 72 float skewport_target_time, | 74 float skewport_target_time, |
| 73 int skewport_extrapolation_limit) | 75 int skewport_extrapolation_limit, |
| 74 : PictureLayerTiling(tree, contents_scale, raster_source, client) {} | 76 float min_preraster_distance, |
| 77 float max_preraster_distance) |
| 78 : PictureLayerTiling(tree, |
| 79 contents_scale, |
| 80 raster_source, |
| 81 client, |
| 82 min_preraster_distance, |
| 83 max_preraster_distance) {} |
| 75 }; | 84 }; |
| 76 | 85 |
| 77 class PictureLayerTilingIteratorTest : public testing::Test { | 86 class PictureLayerTilingIteratorTest : public testing::Test { |
| 78 public: | 87 public: |
| 79 PictureLayerTilingIteratorTest() {} | 88 PictureLayerTilingIteratorTest() {} |
| 80 ~PictureLayerTilingIteratorTest() override {} | 89 ~PictureLayerTilingIteratorTest() override {} |
| 81 | 90 |
| 82 void Initialize(const gfx::Size& tile_size, | 91 void Initialize(const gfx::Size& tile_size, |
| 83 float contents_scale, | 92 float contents_scale, |
| 84 const gfx::Size& layer_bounds) { | 93 const gfx::Size& layer_bounds) { |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale, | 985 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale, |
| 977 raster_source, &client_, | 986 raster_source, &client_, |
| 978 LayerTreeSettings()); | 987 LayerTreeSettings()); |
| 979 | 988 |
| 980 gfx::Rect content_rect(25554432, 25554432, 950, 860); | 989 gfx::Rect content_rect(25554432, 25554432, 950, 860); |
| 981 VerifyTilesExactlyCoverRect(contents_scale, content_rect); | 990 VerifyTilesExactlyCoverRect(contents_scale, content_rect); |
| 982 } | 991 } |
| 983 | 992 |
| 984 } // namespace | 993 } // namespace |
| 985 } // namespace cc | 994 } // namespace cc |
| OLD | NEW |