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