diff options
Diffstat (limited to 'cc/picture_layer_tiling.cc')
-rw-r--r-- | cc/picture_layer_tiling.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/cc/picture_layer_tiling.cc b/cc/picture_layer_tiling.cc index d90eb42..df12b6b 100644 --- a/cc/picture_layer_tiling.cc +++ b/cc/picture_layer_tiling.cc @@ -13,20 +13,18 @@ namespace cc { scoped_ptr<PictureLayerTiling> PictureLayerTiling::Create( - float contents_scale, - gfx::Size tile_size) { - return make_scoped_ptr(new PictureLayerTiling(contents_scale, tile_size)); + float contents_scale) { + return make_scoped_ptr(new PictureLayerTiling(contents_scale)); } scoped_ptr<PictureLayerTiling> PictureLayerTiling::Clone() const { return make_scoped_ptr(new PictureLayerTiling(*this)); } -PictureLayerTiling::PictureLayerTiling(float contents_scale, - gfx::Size tile_size) +PictureLayerTiling::PictureLayerTiling(float contents_scale) : client_(NULL), contents_scale_(contents_scale), - tiling_data_(tile_size, gfx::Size(), true), + tiling_data_(gfx::Size(), gfx::Size(), true), resolution_(NON_IDEAL_RESOLUTION), last_source_frame_number_(0), last_impl_frame_time_(0) { @@ -89,6 +87,14 @@ void PictureLayerTiling::SetLayerBounds(gfx::Size layer_bounds) { return; } + gfx::Size tile_size = client_->CalculateTileSize( + tiling_data_.max_texture_size(), + content_bounds); + if (tile_size != tiling_data_.max_texture_size()) { + tiling_data_.SetMaxTextureSize(tile_size); + tiles_.clear(); + } + // Any tiles outside our new bounds are invalid and should be dropped. if (old_content_bounds.width() > content_bounds.width() || old_content_bounds.height() > content_bounds.height()) { |