| 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 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 tile_version.set_solid_color(analysis.solid_color); | 1192 tile_version.set_solid_color(analysis.solid_color); |
| 1193 resource_pool_->ReleaseResource(resource.Pass()); | 1193 resource_pool_->ReleaseResource(resource.Pass()); |
| 1194 } else { | 1194 } else { |
| 1195 tile_version.set_use_resource(); | 1195 tile_version.set_use_resource(); |
| 1196 tile_version.resource_ = resource.Pass(); | 1196 tile_version.resource_ = resource.Pass(); |
| 1197 | 1197 |
| 1198 bytes_releasable_ += BytesConsumedIfAllocated(tile); | 1198 bytes_releasable_ += BytesConsumedIfAllocated(tile); |
| 1199 ++resources_releasable_; | 1199 ++resources_releasable_; |
| 1200 } | 1200 } |
| 1201 | 1201 |
| 1202 client_->NotifyTileInitialized(tile); |
| 1203 |
| 1202 FreeUnusedResourcesForTile(tile); | 1204 FreeUnusedResourcesForTile(tile); |
| 1203 if (tile->priority(ACTIVE_TREE).distance_to_visible == 0.f) | 1205 if (tile->priority(ACTIVE_TREE).distance_to_visible == 0.f) |
| 1204 did_initialize_visible_tile_ = true; | 1206 did_initialize_visible_tile_ = true; |
| 1205 } | 1207 } |
| 1206 | 1208 |
| 1207 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, | 1209 scoped_refptr<Tile> TileManager::CreateTile(PicturePileImpl* picture_pile, |
| 1208 const gfx::Size& tile_size, | 1210 const gfx::Size& tile_size, |
| 1209 const gfx::Rect& content_rect, | 1211 const gfx::Rect& content_rect, |
| 1210 const gfx::Rect& opaque_rect, | 1212 const gfx::Rect& opaque_rect, |
| 1211 float contents_scale, | 1213 float contents_scale, |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 | 1626 |
| 1625 if (b_priority.resolution != a_priority.resolution) { | 1627 if (b_priority.resolution != a_priority.resolution) { |
| 1626 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || | 1628 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || |
| 1627 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || | 1629 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || |
| 1628 (a_priority.resolution == NON_IDEAL_RESOLUTION); | 1630 (a_priority.resolution == NON_IDEAL_RESOLUTION); |
| 1629 } | 1631 } |
| 1630 return a_priority.IsHigherPriorityThan(b_priority); | 1632 return a_priority.IsHigherPriorityThan(b_priority); |
| 1631 } | 1633 } |
| 1632 | 1634 |
| 1633 } // namespace cc | 1635 } // namespace cc |
| OLD | NEW |