| 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/test/fake_picture_layer_tiling_client.h" | 5 #include "cc/test/fake_picture_layer_tiling_client.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "cc/test/fake_picture_pile_impl.h" |
| 9 #include "cc/test/fake_tile_manager.h" | 10 #include "cc/test/fake_tile_manager.h" |
| 10 | 11 |
| 11 namespace cc { | 12 namespace cc { |
| 12 | 13 |
| 13 class FakeInfinitePicturePileImpl : public PicturePileImpl { | |
| 14 public: | |
| 15 FakeInfinitePicturePileImpl() { | |
| 16 gfx::Size size(std::numeric_limits<int>::max(), | |
| 17 std::numeric_limits<int>::max()); | |
| 18 Resize(size); | |
| 19 recorded_region_ = Region(gfx::Rect(size)); | |
| 20 } | |
| 21 | |
| 22 protected: | |
| 23 virtual ~FakeInfinitePicturePileImpl() {} | |
| 24 }; | |
| 25 | |
| 26 FakePictureLayerTilingClient::FakePictureLayerTilingClient() | 14 FakePictureLayerTilingClient::FakePictureLayerTilingClient() |
| 27 : tile_manager_(new FakeTileManager(&tile_manager_client_)), | 15 : tile_manager_(new FakeTileManager(&tile_manager_client_)), |
| 28 pile_(new FakeInfinitePicturePileImpl()), | 16 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), |
| 29 twin_tiling_(NULL), | 17 twin_tiling_(NULL), |
| 30 allow_create_tile_(true), | 18 allow_create_tile_(true), |
| 31 max_tiles_for_interest_area_(10000), | 19 max_tiles_for_interest_area_(10000), |
| 32 skewport_target_time_in_seconds_(1.0f), | 20 skewport_target_time_in_seconds_(1.0f), |
| 33 skewport_extrapolation_limit_in_content_pixels_(2000) {} | 21 skewport_extrapolation_limit_in_content_pixels_(2000) {} |
| 34 | 22 |
| 35 FakePictureLayerTilingClient::FakePictureLayerTilingClient( | 23 FakePictureLayerTilingClient::FakePictureLayerTilingClient( |
| 36 ResourceProvider* resource_provider) | 24 ResourceProvider* resource_provider) |
| 37 : tile_manager_( | 25 : tile_manager_( |
| 38 new FakeTileManager(&tile_manager_client_, resource_provider)), | 26 new FakeTileManager(&tile_manager_client_, resource_provider)), |
| 39 pile_(new FakeInfinitePicturePileImpl()), | 27 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), |
| 40 twin_tiling_(NULL), | 28 twin_tiling_(NULL), |
| 41 allow_create_tile_(true), | 29 allow_create_tile_(true), |
| 42 max_tiles_for_interest_area_(10000), | 30 max_tiles_for_interest_area_(10000), |
| 43 skewport_target_time_in_seconds_(1.0f) {} | 31 skewport_target_time_in_seconds_(1.0f) {} |
| 44 | 32 |
| 45 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() { | 33 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() { |
| 46 } | 34 } |
| 47 | 35 |
| 48 scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile( | 36 scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile( |
| 49 PictureLayerTiling*, | 37 PictureLayerTiling*, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 79 const Region* FakePictureLayerTilingClient::GetInvalidation() { | 67 const Region* FakePictureLayerTilingClient::GetInvalidation() { |
| 80 return &invalidation_; | 68 return &invalidation_; |
| 81 } | 69 } |
| 82 | 70 |
| 83 const PictureLayerTiling* FakePictureLayerTilingClient::GetTwinTiling( | 71 const PictureLayerTiling* FakePictureLayerTilingClient::GetTwinTiling( |
| 84 const PictureLayerTiling* tiling) const { | 72 const PictureLayerTiling* tiling) const { |
| 85 return twin_tiling_; | 73 return twin_tiling_; |
| 86 } | 74 } |
| 87 | 75 |
| 88 } // namespace cc | 76 } // namespace cc |
| OLD | NEW |