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 #ifndef CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_
6 #define CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_
8 #include "cc/resources/picture_layer_tiling.h"
9 #include "cc/resources/picture_pile_impl.h"
10 #include "cc/resources/tile.h"
11 #include "cc/resources/tile_manager.h"
12 #include "cc/test/fake_rendering_stats_instrumentation.h"
13 #include "cc/test/fake_tile_manager_client.h"
14 #include "ui/gfx/rect.h"
18 class FakePictureLayerTilingClient
: public PictureLayerTilingClient
{
20 FakePictureLayerTilingClient();
21 virtual ~FakePictureLayerTilingClient();
23 // PictureLayerTilingClient implementation.
24 virtual scoped_refptr
<Tile
> CreateTile(
25 PictureLayerTiling
* tiling
, gfx::Rect rect
) OVERRIDE
;
26 virtual void UpdatePile(Tile
* tile
) OVERRIDE
{}
27 virtual gfx::Size
CalculateTileSize(
28 gfx::Size current_tile_size
,
29 gfx::Size content_bounds
) OVERRIDE
;
31 void SetTileSize(gfx::Size tile_size
);
32 gfx::Size
TileSize() const { return tile_size_
; }
33 scoped_refptr
<PicturePileImpl
> pile() { return pile_
; }
36 FakeTileManagerClient tile_manager_client_
;
37 FakeRenderingStatsInstrumentation stats_instrumentation_
;
38 TileManager tile_manager_
;
39 scoped_refptr
<PicturePileImpl
> pile_
;
45 #endif // CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_