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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 void PictureLayerImpl::UpdateIdealScales() { | 1250 void PictureLayerImpl::UpdateIdealScales() { |
1251 DCHECK(CanHaveTilings()); | 1251 DCHECK(CanHaveTilings()); |
1252 | 1252 |
1253 float min_contents_scale = MinimumContentsScale(); | 1253 float min_contents_scale = MinimumContentsScale(); |
1254 DCHECK_GT(min_contents_scale, 0.f); | 1254 DCHECK_GT(min_contents_scale, 0.f); |
1255 | 1255 |
1256 ideal_page_scale_ = IsAffectedByPageScale() | 1256 ideal_page_scale_ = IsAffectedByPageScale() |
1257 ? layer_tree_impl()->current_page_scale_factor() | 1257 ? layer_tree_impl()->current_page_scale_factor() |
1258 : 1.f; | 1258 : 1.f; |
1259 ideal_device_scale_ = layer_tree_impl()->device_scale_factor(); | 1259 ideal_device_scale_ = layer_tree_impl()->device_scale_factor(); |
| 1260 ideal_contents_scale_ = GetIdealContentsScale(); |
| 1261 if (!layer_tree_impl()->PageScaleLayer()) { |
| 1262 float subframe_page_scale_factor = |
| 1263 layer_tree_impl()->GetSubframePageScaleFactor(); |
| 1264 ideal_page_scale_ = subframe_page_scale_factor; |
| 1265 ideal_contents_scale_ *= subframe_page_scale_factor; |
| 1266 } |
1260 ideal_contents_scale_ = | 1267 ideal_contents_scale_ = |
1261 std::min(kMaxIdealContentsScale, | 1268 std::min(kMaxIdealContentsScale, |
1262 std::max(GetIdealContentsScale(), min_contents_scale)); | 1269 std::max(ideal_contents_scale_, min_contents_scale)); |
1263 ideal_source_scale_ = | 1270 ideal_source_scale_ = |
1264 ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_; | 1271 ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_; |
1265 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.IdealContentsScale", | 1272 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.IdealContentsScale", |
1266 ideal_contents_scale_, 1, 10000, 50); | 1273 ideal_contents_scale_, 1, 10000, 50); |
1267 } | 1274 } |
1268 | 1275 |
1269 void PictureLayerImpl::GetDebugBorderProperties( | 1276 void PictureLayerImpl::GetDebugBorderProperties( |
1270 SkColor* color, | 1277 SkColor* color, |
1271 float* width) const { | 1278 float* width) const { |
1272 if (is_directly_composited_image_) { | 1279 if (is_directly_composited_image_) { |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1372 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1366 return !layer_tree_impl()->IsRecycleTree(); | 1373 return !layer_tree_impl()->IsRecycleTree(); |
1367 } | 1374 } |
1368 | 1375 |
1369 bool PictureLayerImpl::HasValidTilePriorities() const { | 1376 bool PictureLayerImpl::HasValidTilePriorities() const { |
1370 return IsOnActiveOrPendingTree() && | 1377 return IsOnActiveOrPendingTree() && |
1371 is_drawn_render_surface_layer_list_member(); | 1378 is_drawn_render_surface_layer_list_member(); |
1372 } | 1379 } |
1373 | 1380 |
1374 } // namespace cc | 1381 } // namespace cc |
OLD | NEW |