Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 2417783005: [Master/Overview CL] Make PageScaleFactor work for oopif subframe.
Patch Set: Rebase to master@{#429656}. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/input/browser_controls_offset_manager_unittest.cc ('k') | cc/proto/layer_tree.proto » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 void PictureLayerImpl::UpdateIdealScales() { 1252 void PictureLayerImpl::UpdateIdealScales() {
1253 DCHECK(CanHaveTilings()); 1253 DCHECK(CanHaveTilings());
1254 1254
1255 float min_contents_scale = MinimumContentsScale(); 1255 float min_contents_scale = MinimumContentsScale();
1256 DCHECK_GT(min_contents_scale, 0.f); 1256 DCHECK_GT(min_contents_scale, 0.f);
1257 1257
1258 ideal_page_scale_ = IsAffectedByPageScale() 1258 ideal_page_scale_ = IsAffectedByPageScale()
1259 ? layer_tree_impl()->current_page_scale_factor() 1259 ? layer_tree_impl()->current_page_scale_factor()
1260 : 1.f; 1260 : 1.f;
1261 ideal_device_scale_ = layer_tree_impl()->device_scale_factor(); 1261 ideal_device_scale_ = layer_tree_impl()->device_scale_factor();
1262 ideal_contents_scale_ = GetIdealContentsScale();
1263
1264 if (!layer_tree_impl()->PageScaleLayer()) {
1265 float subframe_page_scale_factor =
1266 layer_tree_impl()->GetSubframePageScaleFactor();
1267 ideal_page_scale_ = subframe_page_scale_factor;
1268 ideal_contents_scale_ *= subframe_page_scale_factor;
1269 }
1262 ideal_contents_scale_ = 1270 ideal_contents_scale_ =
1263 std::min(kMaxIdealContentsScale, 1271 std::min(kMaxIdealContentsScale,
1264 std::max(GetIdealContentsScale(), min_contents_scale)); 1272 std::max(ideal_contents_scale_, min_contents_scale));
1265 ideal_source_scale_ = 1273 ideal_source_scale_ =
1266 ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_; 1274 ideal_contents_scale_ / ideal_page_scale_ / ideal_device_scale_;
1267 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.IdealContentsScale", 1275 UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.IdealContentsScale",
1268 ideal_contents_scale_, 1, 10000, 50); 1276 ideal_contents_scale_, 1, 10000, 50);
1269 } 1277 }
1270 1278
1271 void PictureLayerImpl::GetDebugBorderProperties( 1279 void PictureLayerImpl::GetDebugBorderProperties(
1272 SkColor* color, 1280 SkColor* color,
1273 float* width) const { 1281 float* width) const {
1274 if (is_directly_composited_image_) { 1282 if (is_directly_composited_image_) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1349 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1342 return !layer_tree_impl()->IsRecycleTree(); 1350 return !layer_tree_impl()->IsRecycleTree();
1343 } 1351 }
1344 1352
1345 bool PictureLayerImpl::HasValidTilePriorities() const { 1353 bool PictureLayerImpl::HasValidTilePriorities() const {
1346 return IsOnActiveOrPendingTree() && 1354 return IsOnActiveOrPendingTree() &&
1347 is_drawn_render_surface_layer_list_member(); 1355 is_drawn_render_surface_layer_list_member();
1348 } 1356 }
1349 1357
1350 } // namespace cc 1358 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/browser_controls_offset_manager_unittest.cc ('k') | cc/proto/layer_tree.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698