| Index: cc/layers/picture_layer_impl.cc
|
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
|
| index bd3b9dc590e413bf998aa6325f95d8fd36386239..215927d49704d35aa0b59fccc490fd167d4189b5 100644
|
| --- a/cc/layers/picture_layer_impl.cc
|
| +++ b/cc/layers/picture_layer_impl.cc
|
| @@ -63,7 +63,6 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, int id)
|
| needs_post_commit_initialization_(true),
|
| should_update_tile_priorities_(false),
|
| should_use_low_res_tiling_(tree_impl->settings().create_low_res_tiling),
|
| - use_gpu_rasterization_(false),
|
| layer_needs_to_register_itself_(true) {
|
| }
|
|
|
| @@ -105,7 +104,6 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
|
|
|
| layer_impl->SetIsMask(is_mask_);
|
| layer_impl->pile_ = pile_;
|
| - layer_impl->use_gpu_rasterization_ = use_gpu_rasterization_;
|
|
|
| // Tilings would be expensive to push, so we swap.
|
| layer_impl->tilings_.swap(tilings_);
|
| @@ -523,14 +521,6 @@ skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
|
| return pile_->GetFlattenedPicture();
|
| }
|
|
|
| -void PictureLayerImpl::SetUseGpuRasterization(bool use_gpu) {
|
| - if (use_gpu_rasterization_ == use_gpu)
|
| - return;
|
| -
|
| - use_gpu_rasterization_ = use_gpu;
|
| - RemoveAllTilings();
|
| -}
|
| -
|
| scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
|
| const gfx::Rect& content_rect) {
|
| if (!pile_->CanRaster(tiling->contents_scale(), content_rect))
|
| @@ -539,7 +529,7 @@ scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
|
| int flags = 0;
|
| if (is_using_lcd_text_)
|
| flags |= Tile::USE_LCD_TEXT;
|
| - if (ShouldUseGpuRasterization())
|
| + if (UseGpuRasterization())
|
| flags |= Tile::USE_GPU_RASTERIZATION;
|
| return layer_tree_impl()->tile_manager()->CreateTile(
|
| pile_.get(),
|
| @@ -562,9 +552,8 @@ const Region* PictureLayerImpl::GetInvalidation() {
|
|
|
| const PictureLayerTiling* PictureLayerImpl::GetTwinTiling(
|
| const PictureLayerTiling* tiling) const {
|
| -
|
| if (!twin_layer_ ||
|
| - twin_layer_->ShouldUseGpuRasterization() != ShouldUseGpuRasterization())
|
| + twin_layer_->UseGpuRasterization() != UseGpuRasterization())
|
| return NULL;
|
| for (size_t i = 0; i < twin_layer_->tilings_->num_tilings(); ++i)
|
| if (twin_layer_->tilings_->tiling_at(i)->contents_scale() ==
|
| @@ -578,7 +567,7 @@ size_t PictureLayerImpl::GetMaxTilesForInterestArea() const {
|
| }
|
|
|
| float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const {
|
| - float skewport_target_time_in_frames = ShouldUseGpuRasterization()
|
| + float skewport_target_time_in_frames = UseGpuRasterization()
|
| ? kGpuSkewportTargetTimeInFrames
|
| : kCpuSkewportTargetTimeInFrames;
|
| return skewport_target_time_in_frames *
|
| @@ -605,7 +594,7 @@ gfx::Size PictureLayerImpl::CalculateTileSize(
|
| layer_tree_impl()->resource_provider()->max_texture_size();
|
|
|
| gfx::Size default_tile_size = layer_tree_impl()->settings().default_tile_size;
|
| - if (ShouldUseGpuRasterization()) {
|
| + if (UseGpuRasterization()) {
|
| // TODO(ernstm) crbug.com/365877: We need a unified way to override the
|
| // default-tile-size.
|
| default_tile_size =
|
| @@ -921,7 +910,7 @@ PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) {
|
| DCHECK(pile_->HasRecordings());
|
|
|
| if (twin_layer_ &&
|
| - twin_layer_->ShouldUseGpuRasterization() == ShouldUseGpuRasterization())
|
| + twin_layer_->UseGpuRasterization() == UseGpuRasterization())
|
| twin_layer_->SyncTiling(tiling);
|
|
|
| return tiling;
|
| @@ -1039,8 +1028,7 @@ bool PictureLayerImpl::ShouldAdjustRasterScale(
|
| return true;
|
|
|
| if (animating_transform_to_screen &&
|
| - raster_contents_scale_ != ideal_contents_scale_ &&
|
| - ShouldUseGpuRasterization())
|
| + raster_contents_scale_ != ideal_contents_scale_ && UseGpuRasterization())
|
| return true;
|
|
|
| bool is_pinching = layer_tree_impl()->PinchGestureActive();
|
| @@ -1140,7 +1128,7 @@ void PictureLayerImpl::RecalculateRasterScales(
|
| // If we're not re-rasterizing during animation, rasterize at the maximum
|
| // scale that will occur during the animation, if the maximum scale is
|
| // known.
|
| - if (animating_transform_to_screen && !ShouldUseGpuRasterization()) {
|
| + if (animating_transform_to_screen && !UseGpuRasterization()) {
|
| if (maximum_animation_contents_scale > 0.f) {
|
| raster_contents_scale_ =
|
| std::max(raster_contents_scale_, maximum_animation_contents_scale);
|
| @@ -1330,7 +1318,7 @@ void PictureLayerImpl::AsValueInto(base::DictionaryValue* state) const {
|
| }
|
| state->Set("coverage_tiles", coverage_tiles.release());
|
| state->SetBoolean("is_using_lcd_text", is_using_lcd_text_);
|
| - state->SetBoolean("using_gpu_rasterization", ShouldUseGpuRasterization());
|
| + state->SetBoolean("using_gpu_rasterization", UseGpuRasterization());
|
| }
|
|
|
| size_t PictureLayerImpl::GPUMemoryUsageInBytes() const {
|
| @@ -1350,6 +1338,10 @@ bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
|
| return !layer_tree_impl()->IsRecycleTree();
|
| }
|
|
|
| +bool PictureLayerImpl::UseGpuRasterization() const {
|
| + return layer_tree_impl()->use_gpu_rasterization();
|
| +}
|
| +
|
| PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator()
|
| : layer_(NULL) {}
|
|
|
|
|