| 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 <limits> | 5 #include <limits> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/test/fake_display_list_raster_source.h" | 9 #include "cc/test/fake_display_list_raster_source.h" |
| 10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 class TestablePictureLayerTiling : public PictureLayerTiling { | 38 class TestablePictureLayerTiling : public PictureLayerTiling { |
| 39 public: | 39 public: |
| 40 using PictureLayerTiling::SetLiveTilesRect; | 40 using PictureLayerTiling::SetLiveTilesRect; |
| 41 using PictureLayerTiling::TileAt; | 41 using PictureLayerTiling::TileAt; |
| 42 | 42 |
| 43 static scoped_ptr<TestablePictureLayerTiling> Create( | 43 static scoped_ptr<TestablePictureLayerTiling> Create( |
| 44 WhichTree tree, | 44 WhichTree tree, |
| 45 float contents_scale, | 45 float contents_scale, |
| 46 scoped_refptr<RasterSource> raster_source, | 46 scoped_refptr<DisplayListRasterSource> raster_source, |
| 47 PictureLayerTilingClient* client, | 47 PictureLayerTilingClient* client, |
| 48 const LayerTreeSettings& settings) { | 48 const LayerTreeSettings& settings) { |
| 49 return make_scoped_ptr(new TestablePictureLayerTiling( | 49 return make_scoped_ptr(new TestablePictureLayerTiling( |
| 50 tree, contents_scale, raster_source, client, | 50 tree, contents_scale, raster_source, client, |
| 51 settings.tiling_interest_area_padding, | 51 settings.tiling_interest_area_padding, |
| 52 settings.skewport_target_time_in_seconds, | 52 settings.skewport_target_time_in_seconds, |
| 53 settings.skewport_extrapolation_limit_in_content_pixels)); | 53 settings.skewport_extrapolation_limit_in_content_pixels)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } | 56 gfx::Rect live_tiles_rect() const { return live_tiles_rect_; } |
| 57 | 57 |
| 58 using PictureLayerTiling::ComputeSkewport; | 58 using PictureLayerTiling::ComputeSkewport; |
| 59 using PictureLayerTiling::RemoveTileAt; | 59 using PictureLayerTiling::RemoveTileAt; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 TestablePictureLayerTiling(WhichTree tree, | 62 TestablePictureLayerTiling( |
| 63 float contents_scale, | 63 WhichTree tree, |
| 64 scoped_refptr<RasterSource> raster_source, | 64 float contents_scale, |
| 65 PictureLayerTilingClient* client, | 65 scoped_refptr<DisplayListRasterSource> raster_source, |
| 66 size_t tiling_interest_area_padding, | 66 PictureLayerTilingClient* client, |
| 67 float skewport_target_time, | 67 size_t tiling_interest_area_padding, |
| 68 int skewport_extrapolation_limit) | 68 float skewport_target_time, |
| 69 int skewport_extrapolation_limit) |
| 69 : PictureLayerTiling(tree, | 70 : PictureLayerTiling(tree, |
| 70 contents_scale, | 71 contents_scale, |
| 71 raster_source, | 72 raster_source, |
| 72 client, | 73 client, |
| 73 tiling_interest_area_padding, | 74 tiling_interest_area_padding, |
| 74 skewport_target_time, | 75 skewport_target_time, |
| 75 skewport_extrapolation_limit) {} | 76 skewport_extrapolation_limit) {} |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 class PictureLayerTilingIteratorTest : public testing::Test { | 79 class PictureLayerTilingIteratorTest : public testing::Test { |
| (...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale, | 1792 tiling_ = TestablePictureLayerTiling::Create(PENDING_TREE, contents_scale, |
| 1792 raster_source, &client_, | 1793 raster_source, &client_, |
| 1793 LayerTreeSettings()); | 1794 LayerTreeSettings()); |
| 1794 | 1795 |
| 1795 gfx::Rect content_rect(25554432, 25554432, 950, 860); | 1796 gfx::Rect content_rect(25554432, 25554432, 950, 860); |
| 1796 VerifyTilesExactlyCoverRect(contents_scale, content_rect); | 1797 VerifyTilesExactlyCoverRect(contents_scale, content_rect); |
| 1797 } | 1798 } |
| 1798 | 1799 |
| 1799 } // namespace | 1800 } // namespace |
| 1800 } // namespace cc | 1801 } // namespace cc |
| OLD | NEW |