OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 gfx::ScaleSize(bounds(), max_contents_scale, max_contents_scale)); | 475 gfx::ScaleSize(bounds(), max_contents_scale, max_contents_scale)); |
476 } | 476 } |
477 | 477 |
478 skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() { | 478 skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() { |
479 return pile_->GetFlattenedPicture(); | 479 return pile_->GetFlattenedPicture(); |
480 } | 480 } |
481 | 481 |
482 void PictureLayerImpl::SetHasGpuRasterizationHint(bool has_hint) { | 482 void PictureLayerImpl::SetHasGpuRasterizationHint(bool has_hint) { |
483 bool old_should_use_gpu_rasterization = ShouldUseGpuRasterization(); | 483 bool old_should_use_gpu_rasterization = ShouldUseGpuRasterization(); |
484 has_gpu_rasterization_hint_ = has_hint; | 484 has_gpu_rasterization_hint_ = has_hint; |
485 if (has_gpu_rasterization_hint_) | |
486 should_use_low_res_tiling_ = false; | |
487 if (ShouldUseGpuRasterization() != old_should_use_gpu_rasterization) | 485 if (ShouldUseGpuRasterization() != old_should_use_gpu_rasterization) |
488 RemoveAllTilings(); | 486 RemoveAllTilings(); |
489 } | 487 } |
490 | 488 |
491 bool PictureLayerImpl::ShouldUseGpuRasterization() const { | 489 bool PictureLayerImpl::ShouldUseGpuRasterization() const { |
492 switch (layer_tree_impl()->settings().rasterization_site) { | 490 switch (layer_tree_impl()->settings().rasterization_site) { |
493 case LayerTreeSettings::CpuRasterization: | 491 case LayerTreeSettings::CpuRasterization: |
494 return false; | 492 return false; |
495 case LayerTreeSettings::HybridRasterization: | 493 case LayerTreeSettings::HybridRasterization: |
496 return has_gpu_rasterization_hint_; | 494 return has_gpu_rasterization_hint_; |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 DCHECK(*this); | 1369 DCHECK(*this); |
1372 | 1370 |
1373 IteratorType index = stages_[current_stage_].iterator_type; | 1371 IteratorType index = stages_[current_stage_].iterator_type; |
1374 DCHECK(iterators_[index]); | 1372 DCHECK(iterators_[index]); |
1375 DCHECK(iterators_[index].get_type() == stages_[current_stage_].tile_type); | 1373 DCHECK(iterators_[index].get_type() == stages_[current_stage_].tile_type); |
1376 | 1374 |
1377 return *iterators_[index]; | 1375 return *iterators_[index]; |
1378 } | 1376 } |
1379 | 1377 |
1380 } // namespace cc | 1378 } // namespace cc |
OLD | NEW |