| 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/tiles/tile_manager.h" | 5 #include "cc/tiles/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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 Resource* resource = nullptr; | 661 Resource* resource = nullptr; |
| 662 if (tile->invalidated_id()) { | 662 if (tile->invalidated_id()) { |
| 663 // TODO(danakj): For resources that are in use, we should still grab them | 663 // TODO(danakj): For resources that are in use, we should still grab them |
| 664 // and copy from them instead of rastering everything. crbug.com/492754 | 664 // and copy from them instead of rastering everything. crbug.com/492754 |
| 665 resource = | 665 resource = |
| 666 resource_pool_->TryAcquireResourceWithContentId(tile->invalidated_id()); | 666 resource_pool_->TryAcquireResourceWithContentId(tile->invalidated_id()); |
| 667 } | 667 } |
| 668 if (resource) { | 668 if (resource) { |
| 669 resource_content_id = tile->invalidated_id(); | 669 resource_content_id = tile->invalidated_id(); |
| 670 DCHECK_EQ(DetermineResourceFormat(tile), resource->format()); | 670 DCHECK_EQ(DetermineResourceFormat(tile), resource->format()); |
| 671 DCHECK_EQ(tile->desired_texture_size().ToString(), | 671 if (!IsResourceFormatCompressed(resource->format())) { |
| 672 resource->size().ToString()); | 672 DCHECK_EQ(tile->desired_texture_size().ToString(), |
| 673 resource->size().ToString()); |
| 674 } |
| 673 } else { | 675 } else { |
| 674 resource = resource_pool_->AcquireResource(tile->desired_texture_size(), | 676 resource = resource_pool_->AcquireResource(tile->desired_texture_size(), |
| 675 DetermineResourceFormat(tile)); | 677 DetermineResourceFormat(tile)); |
| 676 } | 678 } |
| 677 | 679 |
| 678 // Create and queue all image decode tasks that this tile depends on. | 680 // Create and queue all image decode tasks that this tile depends on. |
| 679 ImageDecodeTask::Vector decode_tasks; | 681 ImageDecodeTask::Vector decode_tasks; |
| 680 std::vector<PositionImage> images; | 682 std::vector<PositionImage> images; |
| 681 prioritized_tile.raster_source()->GetDiscardableImagesInRect( | 683 prioritized_tile.raster_source()->GetDiscardableImagesInRect( |
| 682 tile->enclosing_layer_rect(), &images); | 684 tile->enclosing_layer_rect(), &images); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 void TileManager::Signals::reset() { | 1004 void TileManager::Signals::reset() { |
| 1003 ready_to_activate = false; | 1005 ready_to_activate = false; |
| 1004 did_notify_ready_to_activate = false; | 1006 did_notify_ready_to_activate = false; |
| 1005 ready_to_draw = false; | 1007 ready_to_draw = false; |
| 1006 did_notify_ready_to_draw = false; | 1008 did_notify_ready_to_draw = false; |
| 1007 all_tile_tasks_completed = false; | 1009 all_tile_tasks_completed = false; |
| 1008 did_notify_all_tile_tasks_completed = false; | 1010 did_notify_all_tile_tasks_completed = false; |
| 1009 } | 1011 } |
| 1010 | 1012 |
| 1011 } // namespace cc | 1013 } // namespace cc |
| OLD | NEW |