[Password Generation] Make sure to dismiss UI after scrolling
[chromium-blink-merge.git] / cc / test / fake_picture_layer_tiling_client.cc
blob0c0fce69a07ca9e74ac9cd10fa7a64578201f1c3
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_tiling_(NULL),
18 allow_create_tile_(true),
19 max_tiles_for_interest_area_(10000),
20 skewport_target_time_in_seconds_(1.0f),
21 skewport_extrapolation_limit_in_content_pixels_(2000) {}
23 FakePictureLayerTilingClient::FakePictureLayerTilingClient(
24 ResourceProvider* resource_provider)
25 : resource_pool_(
26 ResourcePool::Create(resource_provider, GL_TEXTURE_2D, RGBA_8888)),
27 tile_manager_(
28 new FakeTileManager(&tile_manager_client_, resource_pool_.get())),
29 pile_(FakePicturePileImpl::CreateInfiniteFilledPile()),
30 twin_tiling_(NULL),
31 allow_create_tile_(true),
32 max_tiles_for_interest_area_(10000),
33 skewport_target_time_in_seconds_(1.0f) {}
35 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() {
38 scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile(
39 PictureLayerTiling*,
40 const gfx::Rect& rect) {
41 if (!allow_create_tile_)
42 return scoped_refptr<Tile>();
43 return tile_manager_->CreateTile(
44 pile_.get(), tile_size_, rect, gfx::Rect(), 1, 0, 0, Tile::USE_LCD_TEXT);
47 void FakePictureLayerTilingClient::SetTileSize(const gfx::Size& tile_size) {
48 tile_size_ = tile_size;
51 gfx::Size FakePictureLayerTilingClient::CalculateTileSize(
52 const gfx::Size& /* content_bounds */) const {
53 return tile_size_;
56 size_t FakePictureLayerTilingClient::GetMaxTilesForInterestArea() const {
57 return max_tiles_for_interest_area_;
60 float FakePictureLayerTilingClient::GetSkewportTargetTimeInSeconds() const {
61 return skewport_target_time_in_seconds_;
64 int FakePictureLayerTilingClient::GetSkewportExtrapolationLimitInContentPixels()
65 const {
66 return skewport_extrapolation_limit_in_content_pixels_;
69 const Region* FakePictureLayerTilingClient::GetInvalidation() {
70 return &invalidation_;
73 const PictureLayerTiling* FakePictureLayerTilingClient::GetTwinTiling(
74 const PictureLayerTiling* tiling) const {
75 return twin_tiling_;
78 } // namespace cc