| 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 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 950 bytes_releasable_ += BytesConsumedIfAllocated(tile); | 950 bytes_releasable_ += BytesConsumedIfAllocated(tile); |
| 951 ++resources_releasable_; | 951 ++resources_releasable_; |
| 952 } | 952 } |
| 953 | 953 |
| 954 FreeUnusedResourcesForTile(tile); | 954 FreeUnusedResourcesForTile(tile); |
| 955 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0) | 955 if (tile->priority(ACTIVE_TREE).distance_to_visible_in_pixels == 0) |
| 956 did_initialize_visible_tile_ = true; | 956 did_initialize_visible_tile_ = true; |
| 957 } | 957 } |
| 958 | 958 |
| 959 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, | 959 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, |
| 960 gfx::Size tile_size, | 960 const gfx::Size& tile_size, |
| 961 const gfx::Rect& content_rect, | 961 const gfx::Rect& content_rect, |
| 962 const gfx::Rect& opaque_rect, | 962 const gfx::Rect& opaque_rect, |
| 963 float contents_scale, | 963 float contents_scale, |
| 964 int layer_id, | 964 int layer_id, |
| 965 int source_frame_number, | 965 int source_frame_number, |
| 966 int flags) { | 966 int flags) { |
| 967 scoped_refptr<Tile> tile = make_scoped_refptr(new Tile(this, | 967 scoped_refptr<Tile> tile = make_scoped_refptr(new Tile(this, |
| 968 picture_pile, | 968 picture_pile, |
| 969 tile_size, | 969 tile_size, |
| 970 content_rect, | 970 content_rect, |
| 971 opaque_rect, | 971 opaque_rect, |
| 972 contents_scale, | 972 contents_scale, |
| 973 layer_id, | 973 layer_id, |
| 974 source_frame_number, | 974 source_frame_number, |
| 975 flags)); | 975 flags)); |
| 976 DCHECK(tiles_.find(tile->id()) == tiles_.end()); | 976 DCHECK(tiles_.find(tile->id()) == tiles_.end()); |
| 977 | 977 |
| 978 tiles_[tile->id()] = tile; | 978 tiles_[tile->id()] = tile; |
| 979 used_layer_counts_[tile->layer_id()]++; | 979 used_layer_counts_[tile->layer_id()]++; |
| 980 prioritized_tiles_dirty_ = true; | 980 prioritized_tiles_dirty_ = true; |
| 981 return tile; | 981 return tile; |
| 982 } | 982 } |
| 983 | 983 |
| 984 } // namespace cc | 984 } // namespace cc |
| OLD | NEW |