| 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 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| 11 class FakeInfinitePicturePileImpl : public PicturePileImpl { | 11 class FakeInfinitePicturePileImpl : public PicturePileImpl { |
| 12 public: | 12 public: |
| 13 FakeInfinitePicturePileImpl() | 13 FakeInfinitePicturePileImpl() |
| 14 : PicturePileImpl(false) { | 14 : PicturePileImpl(false) { |
| 15 gfx::Size size(std::numeric_limits<int>::max(), | 15 gfx::Size size(std::numeric_limits<int>::max(), |
| 16 std::numeric_limits<int>::max()); | 16 std::numeric_limits<int>::max()); |
| 17 Resize(size); | 17 Resize(size); |
| 18 recorded_region_ = Region(gfx::Rect(size)); | 18 recorded_region_ = Region(gfx::Rect(size)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 virtual ~FakeInfinitePicturePileImpl() {} | 22 virtual ~FakeInfinitePicturePileImpl() {} |
| 23 }; | 23 }; |
| 24 | 24 |
| 25 FakePictureLayerTilingClient::FakePictureLayerTilingClient() | 25 FakePictureLayerTilingClient::FakePictureLayerTilingClient() |
| 26 : tile_manager_(TileManager::Create(&tile_manager_client_, | 26 : tile_manager_(TileManager::Create(&tile_manager_client_, |
| 27 NULL, | 27 NULL, |
| 28 1, | 28 1, |
| 29 false, | 29 false, |
| 30 &stats_instrumentation_)), | 30 &stats_instrumentation_, |
| 31 false)), |
| 31 pile_(new FakeInfinitePicturePileImpl()), | 32 pile_(new FakeInfinitePicturePileImpl()), |
| 32 twin_tiling_(NULL), | 33 twin_tiling_(NULL), |
| 33 allow_create_tile_(true) {} | 34 allow_create_tile_(true) {} |
| 34 | 35 |
| 35 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() { | 36 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() { |
| 36 } | 37 } |
| 37 | 38 |
| 38 scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile( | 39 scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile( |
| 39 PictureLayerTiling*, | 40 PictureLayerTiling*, |
| 40 gfx::Rect rect) { | 41 gfx::Rect rect) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 68 return twin_tiling_; | 69 return twin_tiling_; |
| 69 } | 70 } |
| 70 | 71 |
| 71 bool FakePictureLayerTilingClient::TileHasText(Tile* tile) { | 72 bool FakePictureLayerTilingClient::TileHasText(Tile* tile) { |
| 72 if (text_rect_.IsEmpty()) | 73 if (text_rect_.IsEmpty()) |
| 73 return false; | 74 return false; |
| 74 return tile->content_rect().Intersects(text_rect_); | 75 return tile->content_rect().Intersects(text_rect_); |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace cc | 78 } // namespace cc |
| OLD | NEW |