Index: cc/layers/picture_layer_impl.cc |
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
index 93d658159516549e0164c2e55790fea982a05370..2f5f46af81ae4c080ef84962cf64d6e68d19b399 100644 |
--- a/cc/layers/picture_layer_impl.cc |
+++ b/cc/layers/picture_layer_impl.cc |
@@ -130,8 +130,8 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { |
DCHECK_LE(tilings_->num_tilings(), |
layer_tree_impl()->create_low_res_tiling() ? 2u : 1u); |
- layer_impl->UpdateRasterSource(raster_source_, &invalidation_, |
- tilings_.get()); |
+ layer_impl->UpdateRasterSource(raster_source_, &invalidation_, tilings_.get(), |
+ gpu_raster_max_texture_size_); |
DCHECK(invalidation_.IsEmpty()); |
// After syncing a solid color layer, the active layer has no tilings. |
@@ -503,7 +503,10 @@ PictureLayerImpl* PictureLayerImpl::GetRecycledTwinLayer() const { |
void PictureLayerImpl::UpdateRasterSource( |
scoped_refptr<RasterSource> raster_source, |
Region* new_invalidation, |
- const PictureLayerTilingSet* pending_set) { |
+ const PictureLayerTilingSet* pending_set, |
+ gfx::Size gpu_raster_max_texture_size) { |
+ gpu_raster_max_texture_size_ = gpu_raster_max_texture_size; |
vmpstr
2015/03/19 23:14:39
It kind of feels like this can be a separate funct
|
+ |
// The bounds and the pile size may differ if the pile wasn't updated (ie. |
// PictureLayer::Update didn't happen). In that case the pile will be empty. |
DCHECK_IMPLIES(!raster_source->GetSize().IsEmpty(), |
@@ -562,7 +565,8 @@ void PictureLayerImpl::UpdateCanUseLCDTextAfterCommit() { |
// Synthetically invalidate everything. |
gfx::Rect bounds_rect(bounds()); |
Region invalidation(bounds_rect); |
- UpdateRasterSource(new_raster_source, &invalidation, nullptr); |
+ UpdateRasterSource(new_raster_source, &invalidation, nullptr, |
+ gpu_raster_max_texture_size_); |
SetUpdateRect(bounds_rect); |
DCHECK(!RasterSourceUsesLCDText()); |
@@ -685,8 +689,8 @@ gfx::Size PictureLayerImpl::CalculateTileSize( |
// For GPU rasterization, we pick an ideal tile size using the viewport |
// so we don't need any settings. The current approach uses 4 tiles |
// to cover the viewport vertically. |
- int viewport_width = layer_tree_impl()->device_viewport_size().width(); |
- int viewport_height = layer_tree_impl()->device_viewport_size().height(); |
+ int viewport_width = gpu_raster_max_texture_size_.width(); |
+ int viewport_height = gpu_raster_max_texture_size_.height(); |
default_tile_width = viewport_width; |
// Also, increase the height proportionally as the width decreases, and |
// pad by our border texels to make the tiles exactly match the viewport. |