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

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

Issue 1939963002: cc: Move prepaint region calculations to the tiling set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // We have to allow for a viewport that is outside of the layer bounds in 503 // We have to allow for a viewport that is outside of the layer bounds in
504 // order to compute tile priorities correctly for offscreen content that 504 // order to compute tile priorities correctly for offscreen content that
505 // is going to make it on screen. However, we also have to limit the 505 // is going to make it on screen. However, we also have to limit the
506 // viewport since it can be very large due to screen_space_transforms. As 506 // viewport since it can be very large due to screen_space_transforms. As
507 // a heuristic, we clip to bounds padded by skewport_extrapolation_limit * 507 // a heuristic, we clip to bounds padded by skewport_extrapolation_limit *
508 // maximum tiling scale, since this should allow sufficient room for 508 // maximum tiling scale, since this should allow sufficient room for
509 // skewport calculations. 509 // skewport calculations.
510 gfx::Rect padded_bounds(bounds()); 510 gfx::Rect padded_bounds(bounds());
511 int padding_amount = layer_tree_impl() 511 int padding_amount = layer_tree_impl()
512 ->settings() 512 ->settings()
513 .skewport_extrapolation_limit_in_content_pixels * 513 .skewport_extrapolation_limit_in_screen_pixels *
514 MaximumTilingContentsScale(); 514 MaximumTilingContentsScale();
515 padded_bounds.Inset(-padding_amount, -padding_amount); 515 padded_bounds.Inset(-padding_amount, -padding_amount);
516 visible_rect_in_content_space.Intersect(padded_bounds); 516 visible_rect_in_content_space.Intersect(padded_bounds);
517 } 517 }
518 } 518 }
519 viewport_rect_for_tile_priority_in_content_space_ = 519 viewport_rect_for_tile_priority_in_content_space_ =
520 visible_rect_in_content_space; 520 visible_rect_in_content_space;
521 } 521 }
522 522
523 PictureLayerImpl* PictureLayerImpl::GetPendingOrActiveTwinLayer() const { 523 PictureLayerImpl* PictureLayerImpl::GetPendingOrActiveTwinLayer() const {
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 } 1185 }
1186 1186
1187 std::unique_ptr<PictureLayerTilingSet> 1187 std::unique_ptr<PictureLayerTilingSet>
1188 PictureLayerImpl::CreatePictureLayerTilingSet() { 1188 PictureLayerImpl::CreatePictureLayerTilingSet() {
1189 const LayerTreeSettings& settings = layer_tree_impl()->settings(); 1189 const LayerTreeSettings& settings = layer_tree_impl()->settings();
1190 return PictureLayerTilingSet::Create( 1190 return PictureLayerTilingSet::Create(
1191 GetTree(), this, settings.tiling_interest_area_padding, 1191 GetTree(), this, settings.tiling_interest_area_padding,
1192 layer_tree_impl()->use_gpu_rasterization() 1192 layer_tree_impl()->use_gpu_rasterization()
1193 ? settings.gpu_rasterization_skewport_target_time_in_seconds 1193 ? settings.gpu_rasterization_skewport_target_time_in_seconds
1194 : settings.skewport_target_time_in_seconds, 1194 : settings.skewport_target_time_in_seconds,
1195 settings.skewport_extrapolation_limit_in_content_pixels); 1195 settings.skewport_extrapolation_limit_in_screen_pixels);
1196 } 1196 }
1197 1197
1198 void PictureLayerImpl::UpdateIdealScales() { 1198 void PictureLayerImpl::UpdateIdealScales() {
1199 DCHECK(CanHaveTilings()); 1199 DCHECK(CanHaveTilings());
1200 1200
1201 float min_contents_scale = MinimumContentsScale(); 1201 float min_contents_scale = MinimumContentsScale();
1202 DCHECK_GT(min_contents_scale, 0.f); 1202 DCHECK_GT(min_contents_scale, 0.f);
1203 1203
1204 ideal_page_scale_ = IsAffectedByPageScale() 1204 ideal_page_scale_ = IsAffectedByPageScale()
1205 ? layer_tree_impl()->current_page_scale_factor() 1205 ? layer_tree_impl()->current_page_scale_factor()
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1278 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1278 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1279 return !layer_tree_impl()->IsRecycleTree(); 1279 return !layer_tree_impl()->IsRecycleTree();
1280 } 1280 }
1281 1281
1282 bool PictureLayerImpl::HasValidTilePriorities() const { 1282 bool PictureLayerImpl::HasValidTilePriorities() const {
1283 return IsOnActiveOrPendingTree() && 1283 return IsOnActiveOrPendingTree() &&
1284 is_drawn_render_surface_layer_list_member(); 1284 is_drawn_render_surface_layer_list_member();
1285 } 1285 }
1286 1286
1287 } // namespace cc 1287 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/rasterize_and_record_benchmark_impl.cc ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698