summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_picture_layer_tiling_client.h
blob: 4cde8cd4035323315b727b974dc3273c5bf5dbc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_
#define CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_

#include "cc/resources/picture_layer_tiling.h"
#include "cc/resources/picture_pile_impl.h"
#include "cc/resources/tile.h"
#include "cc/resources/tile_manager.h"
#include "cc/test/fake_rendering_stats_instrumentation.h"
#include "cc/test/fake_tile_manager_client.h"
#include "ui/gfx/rect.h"

namespace cc {

class FakePictureLayerTilingClient : public PictureLayerTilingClient {
 public:
  FakePictureLayerTilingClient();
  virtual ~FakePictureLayerTilingClient();

  // PictureLayerTilingClient implementation.
  virtual scoped_refptr<Tile> CreateTile(
      PictureLayerTiling* tiling, gfx::Rect rect) OVERRIDE;
  virtual void UpdatePile(Tile* tile) OVERRIDE {}
  virtual gfx::Size CalculateTileSize(
      gfx::Size current_tile_size,
      gfx::Size content_bounds) OVERRIDE;

  void SetTileSize(gfx::Size tile_size);
  gfx::Size TileSize() const { return tile_size_; }
  scoped_refptr<PicturePileImpl> pile() { return pile_; }

 protected:
  FakeTileManagerClient tile_manager_client_;
  FakeRenderingStatsInstrumentation stats_instrumentation_;
  TileManager tile_manager_;
  scoped_refptr<PicturePileImpl> pile_;
  gfx::Size tile_size_;
};

}  // namespace cc

#endif  // CC_TEST_FAKE_PICTURE_LAYER_TILING_CLIENT_H_