| 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 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 tile_version.set_solid_color(analysis.solid_color); | 1216 tile_version.set_solid_color(analysis.solid_color); |
| 1217 resource_pool_->ReleaseResource(resource.Pass()); | 1217 resource_pool_->ReleaseResource(resource.Pass()); |
| 1218 } else { | 1218 } else { |
| 1219 tile_version.set_use_resource(); | 1219 tile_version.set_use_resource(); |
| 1220 tile_version.resource_ = resource.Pass(); | 1220 tile_version.resource_ = resource.Pass(); |
| 1221 | 1221 |
| 1222 bytes_releasable_ += BytesConsumedIfAllocated(tile); | 1222 bytes_releasable_ += BytesConsumedIfAllocated(tile); |
| 1223 ++resources_releasable_; | 1223 ++resources_releasable_; |
| 1224 } | 1224 } |
| 1225 | 1225 |
| 1226 client_->NotifyTileInitialized(tile); |
| 1227 |
| 1226 FreeUnusedResourcesForTile(tile); | 1228 FreeUnusedResourcesForTile(tile); |
| 1227 if (tile->priority(ACTIVE_TREE).distance_to_visible == 0.f) | 1229 if (tile->priority(ACTIVE_TREE).distance_to_visible == 0.f) |
| 1228 did_initialize_visible_tile_ = true; | 1230 did_initialize_visible_tile_ = true; |
| 1229 } | 1231 } |
| 1230 | 1232 |
| 1231 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, | 1233 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, |
| 1232 const gfx::Size& tile_size, | 1234 const gfx::Size& tile_size, |
| 1233 const gfx::Rect& content_rect, | 1235 const gfx::Rect& content_rect, |
| 1234 const gfx::Rect& opaque_rect, | 1236 const gfx::Rect& opaque_rect, |
| 1235 float contents_scale, | 1237 float contents_scale, |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 | 1650 |
| 1649 if (b_priority.resolution != a_priority.resolution) { | 1651 if (b_priority.resolution != a_priority.resolution) { |
| 1650 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || | 1652 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || |
| 1651 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || | 1653 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || |
| 1652 (a_priority.resolution == NON_IDEAL_RESOLUTION); | 1654 (a_priority.resolution == NON_IDEAL_RESOLUTION); |
| 1653 } | 1655 } |
| 1654 return a_priority.IsHigherPriorityThan(b_priority); | 1656 return a_priority.IsHigherPriorityThan(b_priority); |
| 1655 } | 1657 } |
| 1656 | 1658 |
| 1657 } // namespace cc | 1659 } // namespace cc |
| OLD | NEW |