| Index: cc/layers/picture_layer_impl.cc
|
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
|
| index 9dbcb49a2d66386302c3ad67e3e63d87e4d43a61..18df698b7874ebe77f59eb5f927e89e08c3a03dd 100644
|
| --- a/cc/layers/picture_layer_impl.cc
|
| +++ b/cc/layers/picture_layer_impl.cc
|
| @@ -54,8 +54,8 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, int id)
|
| is_using_lcd_text_(tree_impl->settings().can_use_lcd_text),
|
| needs_post_commit_initialization_(true),
|
| should_update_tile_priorities_(false),
|
| - has_gpu_rasterization_hint_(false),
|
| should_use_low_res_tiling_(tree_impl->settings().create_low_res_tiling),
|
| + use_gpu_rasterization_(false),
|
| layer_needs_to_register_itself_(true) {}
|
|
|
| PictureLayerImpl::~PictureLayerImpl() {
|
| @@ -96,7 +96,7 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
|
|
|
| layer_impl->SetIsMask(is_mask_);
|
| layer_impl->pile_ = pile_;
|
| - layer_impl->SetHasGpuRasterizationHint(has_gpu_rasterization_hint_);
|
| + layer_impl->use_gpu_rasterization_ = use_gpu_rasterization_;
|
|
|
| // Tilings would be expensive to push, so we swap. This optimization requires
|
| // an extra invalidation in SyncFromActiveLayer.
|
| @@ -479,24 +479,12 @@ skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
|
| return pile_->GetFlattenedPicture();
|
| }
|
|
|
| -void PictureLayerImpl::SetHasGpuRasterizationHint(bool has_hint) {
|
| - bool old_should_use_gpu_rasterization = ShouldUseGpuRasterization();
|
| - has_gpu_rasterization_hint_ = has_hint;
|
| - if (ShouldUseGpuRasterization() != old_should_use_gpu_rasterization)
|
| - RemoveAllTilings();
|
| -}
|
| +void PictureLayerImpl::SetUseGpuRasterization(bool use_gpu) {
|
| + if (use_gpu_rasterization_ == use_gpu)
|
| + return;
|
|
|
| -bool PictureLayerImpl::ShouldUseGpuRasterization() const {
|
| - switch (layer_tree_impl()->settings().rasterization_site) {
|
| - case LayerTreeSettings::CpuRasterization:
|
| - return false;
|
| - case LayerTreeSettings::HybridRasterization:
|
| - return has_gpu_rasterization_hint_;
|
| - case LayerTreeSettings::GpuRasterization:
|
| - return true;
|
| - }
|
| - NOTREACHED();
|
| - return false;
|
| + use_gpu_rasterization_ = use_gpu;
|
| + RemoveAllTilings();
|
| }
|
|
|
| scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
|
|
|