| 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 "base/thread_task_runner_handle.h" |
| 9 #include "cc/test/fake_picture_pile_impl.h" | 10 #include "cc/test/fake_picture_pile_impl.h" |
| 10 #include "cc/test/fake_tile_manager.h" | 11 #include "cc/test/fake_tile_manager.h" |
| 11 | 12 |
| 12 namespace cc { | 13 namespace cc { |
| 13 | 14 |
| 14 FakePictureLayerTilingClient::FakePictureLayerTilingClient() | 15 FakePictureLayerTilingClient::FakePictureLayerTilingClient() |
| 15 : tile_manager_(new FakeTileManager(&tile_manager_client_)), | 16 : tile_manager_(new FakeTileManager(&tile_manager_client_)), |
| 16 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), | 17 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), |
| 17 twin_set_(nullptr), | 18 twin_set_(nullptr), |
| 18 twin_tiling_(nullptr), | 19 twin_tiling_(nullptr), |
| 19 has_valid_tile_priorities_(true) { | 20 has_valid_tile_priorities_(true) { |
| 20 } | 21 } |
| 21 | 22 |
| 22 FakePictureLayerTilingClient::FakePictureLayerTilingClient( | 23 FakePictureLayerTilingClient::FakePictureLayerTilingClient( |
| 23 ResourceProvider* resource_provider) | 24 ResourceProvider* resource_provider) |
| 24 : resource_pool_(ResourcePool::Create(resource_provider, GL_TEXTURE_2D)), | 25 : resource_pool_( |
| 26 ResourcePool::Create(resource_provider, |
| 27 base::ThreadTaskRunnerHandle::Get().get(), |
| 28 GL_TEXTURE_2D)), |
| 25 tile_manager_( | 29 tile_manager_( |
| 26 new FakeTileManager(&tile_manager_client_, resource_pool_.get())), | 30 new FakeTileManager(&tile_manager_client_, resource_pool_.get())), |
| 27 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), | 31 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()), |
| 28 twin_set_(nullptr), | 32 twin_set_(nullptr), |
| 29 twin_tiling_(nullptr), | 33 twin_tiling_(nullptr), |
| 30 has_valid_tile_priorities_(true) { | 34 has_valid_tile_priorities_(true) {} |
| 31 } | |
| 32 | 35 |
| 33 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() { | 36 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() { |
| 34 } | 37 } |
| 35 | 38 |
| 36 ScopedTilePtr FakePictureLayerTilingClient::CreateTile(float content_scale, | 39 ScopedTilePtr FakePictureLayerTilingClient::CreateTile(float content_scale, |
| 37 const gfx::Rect& rect) { | 40 const gfx::Rect& rect) { |
| 38 return tile_manager_->CreateTile(tile_size_, rect, 1, 0, 0, 0); | 41 return tile_manager_->CreateTile(tile_size_, rect, 1, 0, 0, 0); |
| 39 } | 42 } |
| 40 | 43 |
| 41 void FakePictureLayerTilingClient::SetTileSize(const gfx::Size& tile_size) { | 44 void FakePictureLayerTilingClient::SetTileSize(const gfx::Size& tile_size) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 65 return twin_set_->tiling_at(i); | 68 return twin_set_->tiling_at(i); |
| 66 } | 69 } |
| 67 return nullptr; | 70 return nullptr; |
| 68 } | 71 } |
| 69 | 72 |
| 70 bool FakePictureLayerTilingClient::RequiresHighResToDraw() const { | 73 bool FakePictureLayerTilingClient::RequiresHighResToDraw() const { |
| 71 return false; | 74 return false; |
| 72 } | 75 } |
| 73 | 76 |
| 74 } // namespace cc | 77 } // namespace cc |
| OLD | NEW |