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 | 10 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 bool is_occluded = false; | 488 bool is_occluded = false; |
489 if (occlusion_tracker) { | 489 if (occlusion_tracker) { |
490 gfx::Rect tile_query_rect = ScaleToEnclosingRect( | 490 gfx::Rect tile_query_rect = ScaleToEnclosingRect( |
491 IntersectRects(tile->content_rect(), visible_rect_in_content_space), | 491 IntersectRects(tile->content_rect(), visible_rect_in_content_space), |
492 1.0f / contents_scale_); | 492 1.0f / contents_scale_); |
493 // TODO(vmpstr): Remove render_target and draw_transform from the | 493 // TODO(vmpstr): Remove render_target and draw_transform from the |
494 // parameters so they can be hidden from the tiling. | 494 // parameters so they can be hidden from the tiling. |
495 is_occluded = occlusion_tracker->Occluded( | 495 is_occluded = occlusion_tracker->Occluded( |
496 render_target, tile_query_rect, draw_transform); | 496 render_target, tile_query_rect, draw_transform); |
497 } | 497 } |
498 tile->set_is_occluded(is_occluded); | 498 tile->set_is_occluded(tree, is_occluded); |
499 } | 499 } |
500 | 500 |
501 // Assign soon priority to skewport tiles. | 501 // Assign soon priority to skewport tiles. |
502 for (TilingData::DifferenceIterator iter( | 502 for (TilingData::DifferenceIterator iter( |
503 &tiling_data_, skewport, visible_rect_in_content_space); | 503 &tiling_data_, skewport, visible_rect_in_content_space); |
504 iter; | 504 iter; |
505 ++iter) { | 505 ++iter) { |
506 TileMap::iterator find = tiles_.find(iter.index()); | 506 TileMap::iterator find = tiles_.find(iter.index()); |
507 if (find == tiles_.end()) | 507 if (find == tiles_.end()) |
508 continue; | 508 continue; |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); | 973 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); |
974 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); | 974 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); |
975 is_valid_ = true; | 975 is_valid_ = true; |
976 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && | 976 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && |
977 !(*tile_iterator_)->HasResources()) { | 977 !(*tile_iterator_)->HasResources()) { |
978 ++(*this); | 978 ++(*this); |
979 } | 979 } |
980 } | 980 } |
981 | 981 |
982 } // namespace cc | 982 } // namespace cc |
OLD | NEW |