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"
9 #include "cc/test/fake_tile_manager.h"
13 class FakeInfinitePicturePileImpl
: public PicturePileImpl
{
15 FakeInfinitePicturePileImpl() {
16 gfx::Size
size(std::numeric_limits
<int>::max(),
17 std::numeric_limits
<int>::max());
19 recorded_region_
= Region(gfx::Rect(size
));
23 virtual ~FakeInfinitePicturePileImpl() {}
26 FakePictureLayerTilingClient::FakePictureLayerTilingClient()
27 : tile_manager_(new FakeTileManager(&tile_manager_client_
)),
28 pile_(new FakeInfinitePicturePileImpl()),
30 allow_create_tile_(true) {}
32 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() {
35 scoped_refptr
<Tile
> FakePictureLayerTilingClient::CreateTile(
38 if (!allow_create_tile_
)
40 return new Tile(tile_manager_
.get(),
51 void FakePictureLayerTilingClient::SetTileSize(gfx::Size tile_size
) {
52 tile_size_
= tile_size
;
55 gfx::Size
FakePictureLayerTilingClient::CalculateTileSize(
56 gfx::Size
/* content_bounds */) const {
60 const Region
* FakePictureLayerTilingClient::GetInvalidation() {
61 return &invalidation_
;
64 const PictureLayerTiling
* FakePictureLayerTilingClient::GetTwinTiling(
65 const PictureLayerTiling
* tiling
) {