Fix a type mismatch on Windows caused by r201738.
[chromium-blink-merge.git] / cc / test / fake_picture_layer_tiling_client.cc
blobebd530a7f8058b7e32fea5895ddefeab301fc05b
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 namespace cc {
11 class FakeInfinitePicturePileImpl : public PicturePileImpl {
12 public:
13 FakeInfinitePicturePileImpl()
14 : PicturePileImpl(false) {
15 gfx::Size size(std::numeric_limits<int>::max(),
16 std::numeric_limits<int>::max());
17 Resize(size);
18 recorded_region_ = Region(gfx::Rect(size));
21 protected:
22 virtual ~FakeInfinitePicturePileImpl() {}
25 FakePictureLayerTilingClient::FakePictureLayerTilingClient()
26 : tile_manager_(TileManager::Create(&tile_manager_client_,
27 NULL,
29 false,
30 &stats_instrumentation_,
31 false)),
32 pile_(new FakeInfinitePicturePileImpl()),
33 twin_tiling_(NULL),
34 allow_create_tile_(true) {}
36 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() {
39 scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile(
40 PictureLayerTiling*,
41 gfx::Rect rect) {
42 if (!allow_create_tile_)
43 return NULL;
44 return new Tile(tile_manager_.get(),
45 pile_.get(),
46 tile_size_,
47 rect,
48 gfx::Rect(),
51 0);
54 void FakePictureLayerTilingClient::SetTileSize(gfx::Size tile_size) {
55 tile_size_ = tile_size;
58 gfx::Size FakePictureLayerTilingClient::CalculateTileSize(
59 gfx::Size /* content_bounds */) {
60 return tile_size_;
63 const Region* FakePictureLayerTilingClient::GetInvalidation() {
64 return &invalidation_;
67 const PictureLayerTiling* FakePictureLayerTilingClient::GetTwinTiling(
68 const PictureLayerTiling* tiling) {
69 return twin_tiling_;
72 bool FakePictureLayerTilingClient::TileHasText(Tile* tile) {
73 if (text_rect_.IsEmpty())
74 return false;
75 return tile->content_rect().Intersects(text_rect_);
78 } // namespace cc