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 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 } | 1122 } |
1123 | 1123 |
1124 float PictureLayerImpl::MaximumTilingContentsScale() const { | 1124 float PictureLayerImpl::MaximumTilingContentsScale() const { |
1125 float max_contents_scale = tilings_->GetMaximumContentsScale(); | 1125 float max_contents_scale = tilings_->GetMaximumContentsScale(); |
1126 return std::max(max_contents_scale, MinimumContentsScale()); | 1126 return std::max(max_contents_scale, MinimumContentsScale()); |
1127 } | 1127 } |
1128 | 1128 |
1129 scoped_ptr<PictureLayerTilingSet> | 1129 scoped_ptr<PictureLayerTilingSet> |
1130 PictureLayerImpl::CreatePictureLayerTilingSet() { | 1130 PictureLayerImpl::CreatePictureLayerTilingSet() { |
1131 const LayerTreeSettings& settings = layer_tree_impl()->settings(); | 1131 const LayerTreeSettings& settings = layer_tree_impl()->settings(); |
| 1132 float skewport_scaling = 1.0f; |
| 1133 if (layer_tree_impl()->use_gpu_rasterization()) |
| 1134 skewport_scaling = |
| 1135 settings.threaded_gpu_rasterization_enabled ? 0.2f : 0.0f; |
1132 return PictureLayerTilingSet::Create( | 1136 return PictureLayerTilingSet::Create( |
1133 this, settings.max_tiles_for_interest_area, | 1137 this, settings.max_tiles_for_interest_area, |
1134 layer_tree_impl()->use_gpu_rasterization() | 1138 settings.skewport_target_time_in_seconds * skewport_scaling, |
1135 ? 0.f | |
1136 : settings.skewport_target_time_in_seconds, | |
1137 settings.skewport_extrapolation_limit_in_content_pixels); | 1139 settings.skewport_extrapolation_limit_in_content_pixels); |
1138 } | 1140 } |
1139 | 1141 |
1140 void PictureLayerImpl::UpdateIdealScales() { | 1142 void PictureLayerImpl::UpdateIdealScales() { |
1141 DCHECK(CanHaveTilings()); | 1143 DCHECK(CanHaveTilings()); |
1142 | 1144 |
1143 float min_contents_scale = MinimumContentsScale(); | 1145 float min_contents_scale = MinimumContentsScale(); |
1144 DCHECK_GT(min_contents_scale, 0.f); | 1146 DCHECK_GT(min_contents_scale, 0.f); |
1145 float min_page_scale = layer_tree_impl()->min_page_scale_factor(); | 1147 float min_page_scale = layer_tree_impl()->min_page_scale_factor(); |
1146 DCHECK_GT(min_page_scale, 0.f); | 1148 DCHECK_GT(min_page_scale, 0.f); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 | 1227 |
1226 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1228 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1227 return !layer_tree_impl()->IsRecycleTree(); | 1229 return !layer_tree_impl()->IsRecycleTree(); |
1228 } | 1230 } |
1229 | 1231 |
1230 bool PictureLayerImpl::HasValidTilePriorities() const { | 1232 bool PictureLayerImpl::HasValidTilePriorities() const { |
1231 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1233 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1232 } | 1234 } |
1233 | 1235 |
1234 } // namespace cc | 1236 } // namespace cc |
OLD | NEW |