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/resources/picture_layer_tiling.h" | 5 #include "cc/resources/picture_layer_tiling.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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // Clip the skewport to |max_skewport|. | 529 // Clip the skewport to |max_skewport|. |
530 skewport.Intersect(max_skewport); | 530 skewport.Intersect(max_skewport); |
531 | 531 |
532 // Finally, ensure that visible rect is contained in the skewport. | 532 // Finally, ensure that visible rect is contained in the skewport. |
533 skewport.Union(visible_rect_in_content_space); | 533 skewport.Union(visible_rect_in_content_space); |
534 return skewport; | 534 return skewport; |
535 } | 535 } |
536 | 536 |
537 void PictureLayerTiling::UpdateTilePriorities( | 537 void PictureLayerTiling::UpdateTilePriorities( |
538 WhichTree tree, | 538 WhichTree tree, |
539 const gfx::Rect& visible_layer_rect, | 539 const gfx::Rect& viewport_in_layer_space, |
540 float ideal_contents_scale, | 540 float ideal_contents_scale, |
541 double current_frame_time_in_seconds, | 541 double current_frame_time_in_seconds, |
542 const Occlusion& occlusion_in_layer_space) { | 542 const Occlusion& occlusion_in_layer_space) { |
543 if (!NeedsUpdateForFrameAtTime(current_frame_time_in_seconds)) { | 543 if (!NeedsUpdateForFrameAtTime(current_frame_time_in_seconds)) { |
544 // This should never be zero for the purposes of has_ever_been_updated(). | 544 // This should never be zero for the purposes of has_ever_been_updated(). |
545 DCHECK_NE(current_frame_time_in_seconds, 0.0); | 545 DCHECK_NE(current_frame_time_in_seconds, 0.0); |
546 return; | 546 return; |
547 } | 547 } |
548 | 548 |
549 gfx::Rect visible_rect_in_content_space = | 549 gfx::Rect visible_rect_in_content_space = |
550 gfx::ScaleToEnclosingRect(visible_layer_rect, contents_scale_); | 550 gfx::ScaleToEnclosingRect(viewport_in_layer_space, contents_scale_); |
551 | 551 |
552 if (tiling_size().IsEmpty()) { | 552 if (tiling_size().IsEmpty()) { |
553 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; | 553 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; |
554 last_visible_rect_in_content_space_ = visible_rect_in_content_space; | 554 last_visible_rect_in_content_space_ = visible_rect_in_content_space; |
555 return; | 555 return; |
556 } | 556 } |
557 | 557 |
558 size_t max_tiles_for_interest_area = client_->GetMaxTilesForInterestArea(); | 558 size_t max_tiles_for_interest_area = client_->GetMaxTilesForInterestArea(); |
559 | 559 |
560 gfx::Size tile_size = tiling_data_.max_texture_size(); | 560 gfx::Size tile_size = tiling_data_.max_texture_size(); |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 DCHECK(*this); | 1191 DCHECK(*this); |
1192 do { | 1192 do { |
1193 ++current_eviction_tiles_index_; | 1193 ++current_eviction_tiles_index_; |
1194 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && | 1194 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && |
1195 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); | 1195 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); |
1196 | 1196 |
1197 return *this; | 1197 return *this; |
1198 } | 1198 } |
1199 | 1199 |
1200 } // namespace cc | 1200 } // namespace cc |
OLD | NEW |