add a use_alsa gyp setting
[chromium-blink-merge.git] / cc / test / fake_picture_layer_tiling_client.cc
blobe3c2f6b8c5fd11a6f8f6af685e6dad8dd72b58b4
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 namespace cc {
9 class FakeInfinitePicturePileImpl : public PicturePileImpl
11 public:
12 FakeInfinitePicturePileImpl() {
13 gfx::Size size(std::numeric_limits<int>::max(),
14 std::numeric_limits<int>::max());
15 Resize(size);
16 recorded_region_ = Region(gfx::Rect(size));
19 protected:
20 ~FakeInfinitePicturePileImpl() {}
23 FakePictureLayerTilingClient::FakePictureLayerTilingClient()
24 : tile_manager_(&tile_manager_client_, NULL, 1, false),
25 pile_(new FakeInfinitePicturePileImpl()) {
28 FakePictureLayerTilingClient::~FakePictureLayerTilingClient() {
31 scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile(
32 PictureLayerTiling*,
33 gfx::Rect rect) {
34 return make_scoped_refptr(new Tile(&tile_manager_,
35 pile_.get(),
36 tile_size_,
37 GL_RGBA,
38 rect,
39 gfx::Rect(),
41 0));
44 void FakePictureLayerTilingClient::SetTileSize(gfx::Size tile_size) {
45 tile_size_ = tile_size;
48 gfx::Size FakePictureLayerTilingClient::CalculateTileSize(
49 gfx::Size /* current_tile_size */,
50 gfx::Size /* content_bounds */) {
51 return tile_size_;
54 } // namespace cc