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->SetIsOccluded(tree, is_occluded); |
vmpstr
2014/06/17 23:42:10
I don't really like the fact that this is very bri
jbedley
2014/06/18 23:00:39
Yes, is_occluded works in the constructor. I remov
| |
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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
971 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); | 971 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); |
972 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); | 972 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); |
973 is_valid_ = true; | 973 is_valid_ = true; |
974 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && | 974 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && |
975 !(*tile_iterator_)->HasResources()) { | 975 !(*tile_iterator_)->HasResources()) { |
976 ++(*this); | 976 ++(*this); |
977 } | 977 } |
978 } | 978 } |
979 | 979 |
980 } // namespace cc | 980 } // namespace cc |
OLD | NEW |