summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_picture_layer_tiling_client.cc
blob: 689d50ecbd4fff3e61597c4bd79d1fcec68c4fec (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
// 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.

#include "cc/test/fake_picture_layer_tiling_client.h"

namespace cc {

FakePictureLayerTilingClient::FakePictureLayerTilingClient()
    : tile_manager_(&tile_manager_client_, NULL, 1, false),
      pile_(PicturePileImpl::Create()) {
}

FakePictureLayerTilingClient::~FakePictureLayerTilingClient() {
}

scoped_refptr<Tile> FakePictureLayerTilingClient::CreateTile(
    PictureLayerTiling*,
    gfx::Rect rect) {
  return make_scoped_refptr(new Tile(&tile_manager_,
                                     pile_.get(),
                                     tile_size_,
                                     GL_RGBA,
                                     rect,
                                     1));
}

void FakePictureLayerTilingClient::SetTileSize(gfx::Size tile_size) {
    tile_size_ = tile_size;
}

}  // namespace cc