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

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

Issue 667053003: cc: Consider visible rect for update tile priority early out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling.h » ('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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 10
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 UpdateTilePriorities(occlusion_in_content_space); 488 UpdateTilePriorities(occlusion_in_content_space);
489 } 489 }
490 490
491 void PictureLayerImpl::UpdateTilePriorities( 491 void PictureLayerImpl::UpdateTilePriorities(
492 const Occlusion& occlusion_in_content_space) { 492 const Occlusion& occlusion_in_content_space) {
493 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings()); 493 DCHECK(!pile_->is_solid_color() || !tilings_->num_tilings());
494 494
495 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); 495 TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities");
496 496
497 double current_frame_time_in_seconds =
498 (layer_tree_impl()->CurrentBeginFrameArgs().frame_time -
499 base::TimeTicks()).InSecondsF();
mithro-old 2014/10/27 13:20:36 Just a FYI, these lines will totally not do what y
500
501 bool tiling_needs_update = false;
502 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
503 if (tilings_->tiling_at(i)->NeedsUpdateForFrameAtTime(
504 current_frame_time_in_seconds)) {
505 tiling_needs_update = true;
506 break;
507 }
508 }
509 if (!tiling_needs_update)
510 return;
511
512 gfx::Rect viewport_rect_in_layer_space = 497 gfx::Rect viewport_rect_in_layer_space =
513 GetViewportForTilePriorityInContentSpace(); 498 GetViewportForTilePriorityInContentSpace();
514 WhichTree tree = 499 WhichTree tree =
515 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE; 500 layer_tree_impl()->IsActiveTree() ? ACTIVE_TREE : PENDING_TREE;
516 bool can_require_tiles_for_activation = 501 bool can_require_tiles_for_activation =
517 !only_used_low_res_last_append_quads_ || RequiresHighResToDraw() || 502 !only_used_low_res_last_append_quads_ || RequiresHighResToDraw() ||
518 !layer_tree_impl()->SmoothnessTakesPriority(); 503 !layer_tree_impl()->SmoothnessTakesPriority();
519 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { 504 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
520 PictureLayerTiling* tiling = tilings_->tiling_at(i); 505 PictureLayerTiling* tiling = tilings_->tiling_at(i);
521 506
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); 1670 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange();
1686 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; 1671 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start;
1687 return tiling_range.end - 1 - current_tiling_range_offset; 1672 return tiling_range.end - 1 - current_tiling_range_offset;
1688 } 1673 }
1689 } 1674 }
1690 NOTREACHED(); 1675 NOTREACHED();
1691 return 0; 1676 return 0;
1692 } 1677 }
1693 1678
1694 } // namespace cc 1679 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698