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/tile_manager.h" | 5 #include "cc/resources/tile_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
962 ++resources_releasable_; | 962 ++resources_releasable_; |
963 } | 963 } |
964 | 964 |
965 FreeUnusedResourcesForTile(tile); | 965 FreeUnusedResourcesForTile(tile); |
966 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0) | 966 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0) |
967 did_initialize_visible_tile_ = true; | 967 did_initialize_visible_tile_ = true; |
968 } | 968 } |
969 | 969 |
970 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, | 970 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, |
971 gfx::Size tile_size, | 971 gfx::Size tile_size, |
972 gfx::Rect content_rect, | 972 const gfx::Rect& content_rect, |
973 gfx::Rect opaque_rect, | 973 const gfx::Rect& opaque_rect, |
974 float contents_scale, | 974 float contents_scale, |
975 int layer_id, | 975 int layer_id, |
976 int source_frame_number, | 976 int source_frame_number, |
977 int flags) { | 977 int flags) { |
978 scoped_refptr<Tile> tile = make_scoped_refptr(new Tile(this, | 978 scoped_refptr<Tile> tile = make_scoped_refptr(new Tile(this, |
979 picture_pile, | 979 picture_pile, |
980 tile_size, | 980 tile_size, |
981 content_rect, | 981 content_rect, |
982 opaque_rect, | 982 opaque_rect, |
983 contents_scale, | 983 contents_scale, |
984 layer_id, | 984 layer_id, |
985 source_frame_number, | 985 source_frame_number, |
986 flags)); | 986 flags)); |
987 DCHECK(tiles_.find(tile->id()) == tiles_.end()); | 987 DCHECK(tiles_.find(tile->id()) == tiles_.end()); |
988 | 988 |
989 tiles_[tile->id()] = tile; | 989 tiles_[tile->id()] = tile; |
990 used_layer_counts_[tile->layer_id()]++; | 990 used_layer_counts_[tile->layer_id()]++; |
991 prioritized_tiles_dirty_ = true; | 991 prioritized_tiles_dirty_ = true; |
992 return tile; | 992 return tile; |
993 } | 993 } |
994 | 994 |
995 } // namespace cc | 995 } // namespace cc |
OLD | NEW |