Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / cc / test / fake_picture_layer_tiling_client.cc
blob75eff0c69765ebca9df5b8055b617433d48084c5
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
3 // found in the LICENSE file.
5 #include "cc/test/fake_picture_layer_tiling_client.h"
7 #include <limits>
9 #include "cc/test/fake_picture_pile_impl.h"
10 #include "cc/test/fake_tile_manager.h"
12 namespace cc {
14 FakePictureLayerTilingClient::FakePictureLayerTilingClient()
15 : tile_manager_(new FakeTileManager(&tile_manager_client_)),
16 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()),
17 twin_set_(nullptr),
18 twin_tiling_(nullptr),
19 max_tile_priority_bin_(TilePriority::NOW) {
22 FakePictureLayerTilingClient::FakePictureLayerTilingClient(
23 ResourceProvider* resource_provider)
24 : resource_pool_(ResourcePool::Create(resource_provider, GL_TEXTURE_2D)),
25 tile_manager_(
26 new FakeTileManager(&tile_manager_client_, resource_pool_.get())),
27 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()),
28 twin_set_(nullptr),
29 twin_tiling_(nullptr),
30 max_tile_priority_bin_(TilePriority::NOW) {
33 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() {
36 ScopedTilePtr FakePictureLayerTilingClient::CreateTile(float content_scale,
37 const gfx::Rect& rect) {
38 return tile_manager_->CreateTile(tile_size_, rect, 1, 0, 0, 0);
41 void FakePictureLayerTilingClient::SetTileSize(const gfx::Size& tile_size) {
42 tile_size_ = tile_size;
45 gfx::Size FakePictureLayerTilingClient::CalculateTileSize(
46 const gfx::Size& /* content_bounds */) const {
47 return tile_size_;
50 TilePriority::PriorityBin FakePictureLayerTilingClient::GetMaxTilePriorityBin()
51 const {
52 return max_tile_priority_bin_;
55 const Region* FakePictureLayerTilingClient::GetPendingInvalidation() {
56 return &invalidation_;
59 const PictureLayerTiling*
60 FakePictureLayerTilingClient::GetPendingOrActiveTwinTiling(
61 const PictureLayerTiling* tiling) const {
62 if (!twin_set_)
63 return twin_tiling_;
64 for (size_t i = 0; i < twin_set_->num_tilings(); ++i) {
65 if (twin_set_->tiling_at(i)->contents_scale() == tiling->contents_scale())
66 return twin_set_->tiling_at(i);
68 return nullptr;
71 bool FakePictureLayerTilingClient::RequiresHighResToDraw() const {
72 return false;
75 } // namespace cc