| 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 skewport.Union(visible_rect_in_content_space); | 531 skewport.Union(visible_rect_in_content_space); |
| 532 return skewport; | 532 return skewport; |
| 533 } | 533 } |
| 534 | 534 |
| 535 void PictureLayerTiling::ComputeTilePriorityRects( | 535 void PictureLayerTiling::ComputeTilePriorityRects( |
| 536 WhichTree tree, | 536 WhichTree tree, |
| 537 const gfx::Rect& viewport_in_layer_space, | 537 const gfx::Rect& viewport_in_layer_space, |
| 538 float ideal_contents_scale, | 538 float ideal_contents_scale, |
| 539 double current_frame_time_in_seconds, | 539 double current_frame_time_in_seconds, |
| 540 const Occlusion& occlusion_in_layer_space) { | 540 const Occlusion& occlusion_in_layer_space) { |
| 541 if (!NeedsUpdateForFrameAtTime(current_frame_time_in_seconds)) { | |
| 542 // This should never be zero for the purposes of has_ever_been_updated(). | |
| 543 DCHECK_NE(current_frame_time_in_seconds, 0.0); | |
| 544 return; | |
| 545 } | |
| 546 | |
| 547 gfx::Rect visible_rect_in_content_space = | 541 gfx::Rect visible_rect_in_content_space = |
| 548 gfx::ScaleToEnclosingRect(viewport_in_layer_space, contents_scale_); | 542 gfx::ScaleToEnclosingRect(viewport_in_layer_space, contents_scale_); |
| 549 | 543 |
| 550 if (tiling_size().IsEmpty()) { | 544 if (tiling_size().IsEmpty()) { |
| 551 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; | 545 last_impl_frame_time_in_seconds_ = current_frame_time_in_seconds; |
| 552 last_visible_rect_in_content_space_ = visible_rect_in_content_space; | 546 last_visible_rect_in_content_space_ = visible_rect_in_content_space; |
| 553 return; | 547 return; |
| 554 } | 548 } |
| 555 | 549 |
| 556 // Calculate the skewport. | 550 // Calculate the skewport. |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1222 DCHECK(*this); | 1216 DCHECK(*this); |
| 1223 do { | 1217 do { |
| 1224 ++current_eviction_tiles_index_; | 1218 ++current_eviction_tiles_index_; |
| 1225 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && | 1219 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && |
| 1226 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); | 1220 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); |
| 1227 | 1221 |
| 1228 return *this; | 1222 return *this; |
| 1229 } | 1223 } |
| 1230 | 1224 |
| 1231 } // namespace cc | 1225 } // namespace cc |
| OLD | NEW |