Chromium Code Reviews| 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 <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1129 } | 1129 } |
| 1130 | 1130 |
| 1131 float PictureLayerImpl::MaximumTilingContentsScale() const { | 1131 float PictureLayerImpl::MaximumTilingContentsScale() const { |
| 1132 float max_contents_scale = tilings_->GetMaximumContentsScale(); | 1132 float max_contents_scale = tilings_->GetMaximumContentsScale(); |
| 1133 return std::max(max_contents_scale, MinimumContentsScale()); | 1133 return std::max(max_contents_scale, MinimumContentsScale()); |
| 1134 } | 1134 } |
| 1135 | 1135 |
| 1136 scoped_ptr<PictureLayerTilingSet> | 1136 scoped_ptr<PictureLayerTilingSet> |
| 1137 PictureLayerImpl::CreatePictureLayerTilingSet() { | 1137 PictureLayerImpl::CreatePictureLayerTilingSet() { |
| 1138 const LayerTreeSettings& settings = layer_tree_impl()->settings(); | 1138 const LayerTreeSettings& settings = layer_tree_impl()->settings(); |
| 1139 float skewport_scaling = 1.0f; | |
| 1140 if (layer_tree_impl()->use_gpu_rasterization()) { | |
| 1141 skewport_scaling = | |
| 1142 settings.threaded_gpu_rasterization_enabled ? 0.2f : 0.0f; | |
|
enne (OOO)
2015/02/11 18:19:51
Maybe if threaded_gpu_rasterization_enabled, the e
vmpstr
2015/02/11 19:00:51
I agree, I think this could be nicer if the settin
vmiura
2015/02/11 20:13:18
Because of vetoing we want to be able to switch fr
enne (OOO)
2015/02/11 20:45:15
Yeah, a different setting seems better, in that ca
vmiura
2015/02/11 22:12:50
Done.
| |
| 1143 } | |
| 1139 return PictureLayerTilingSet::Create( | 1144 return PictureLayerTilingSet::Create( |
| 1140 this, settings.max_tiles_for_interest_area, | 1145 this, settings.max_tiles_for_interest_area, |
| 1141 layer_tree_impl()->use_gpu_rasterization() | 1146 settings.skewport_target_time_in_seconds * skewport_scaling, |
| 1142 ? 0.f | |
| 1143 : settings.skewport_target_time_in_seconds, | |
| 1144 settings.skewport_extrapolation_limit_in_content_pixels); | 1147 settings.skewport_extrapolation_limit_in_content_pixels); |
| 1145 } | 1148 } |
| 1146 | 1149 |
| 1147 void PictureLayerImpl::UpdateIdealScales() { | 1150 void PictureLayerImpl::UpdateIdealScales() { |
| 1148 DCHECK(CanHaveTilings()); | 1151 DCHECK(CanHaveTilings()); |
| 1149 | 1152 |
| 1150 float min_contents_scale = MinimumContentsScale(); | 1153 float min_contents_scale = MinimumContentsScale(); |
| 1151 DCHECK_GT(min_contents_scale, 0.f); | 1154 DCHECK_GT(min_contents_scale, 0.f); |
| 1152 float min_page_scale = layer_tree_impl()->min_page_scale_factor(); | 1155 float min_page_scale = layer_tree_impl()->min_page_scale_factor(); |
| 1153 DCHECK_GT(min_page_scale, 0.f); | 1156 DCHECK_GT(min_page_scale, 0.f); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1233 | 1236 |
| 1234 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1237 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
| 1235 return !layer_tree_impl()->IsRecycleTree(); | 1238 return !layer_tree_impl()->IsRecycleTree(); |
| 1236 } | 1239 } |
| 1237 | 1240 |
| 1238 bool PictureLayerImpl::HasValidTilePriorities() const { | 1241 bool PictureLayerImpl::HasValidTilePriorities() const { |
| 1239 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1242 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
| 1240 } | 1243 } |
| 1241 | 1244 |
| 1242 } // namespace cc | 1245 } // namespace cc |
| OLD | NEW |