| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 873 |
| 874 // Create and queue all image decode tasks that this tile depends on. | 874 // Create and queue all image decode tasks that this tile depends on. |
| 875 ImageDecodeTask::Vector decode_tasks; | 875 ImageDecodeTask::Vector decode_tasks; |
| 876 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; | 876 std::vector<DrawImage>& images = scheduled_draw_images_[tile->id()]; |
| 877 images.clear(); | 877 images.clear(); |
| 878 if (!playback_settings.skip_images) { | 878 if (!playback_settings.skip_images) { |
| 879 prioritized_tile.raster_source()->GetDiscardableImagesInRect( | 879 prioritized_tile.raster_source()->GetDiscardableImagesInRect( |
| 880 tile->enclosing_layer_rect(), tile->contents_scale(), &images); | 880 tile->enclosing_layer_rect(), tile->contents_scale(), &images); |
| 881 } | 881 } |
| 882 | 882 |
| 883 // TODO(vmpstr): We should disable image hijack canvas in | 883 // We can skip the image hijack canvas if we have no images. |
| 884 // |playback_settings| here if |images| is empty. | 884 playback_settings.use_image_hijack_canvas = !images.empty(); |
| 885 | |
| 886 for (auto it = images.begin(); it != images.end();) { | 885 for (auto it = images.begin(); it != images.end();) { |
| 887 scoped_refptr<ImageDecodeTask> task; | 886 scoped_refptr<ImageDecodeTask> task; |
| 888 bool need_to_unref_when_finished = | 887 bool need_to_unref_when_finished = |
| 889 image_decode_controller_->GetTaskForImageAndRef( | 888 image_decode_controller_->GetTaskForImageAndRef( |
| 890 *it, prepare_tiles_count_, &task); | 889 *it, prepare_tiles_count_, &task); |
| 891 if (task) | 890 if (task) |
| 892 decode_tasks.push_back(task); | 891 decode_tasks.push_back(task); |
| 893 | 892 |
| 894 if (need_to_unref_when_finished) | 893 if (need_to_unref_when_finished) |
| 895 ++it; | 894 ++it; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 void TileManager::Signals::reset() { | 1235 void TileManager::Signals::reset() { |
| 1237 ready_to_activate = false; | 1236 ready_to_activate = false; |
| 1238 did_notify_ready_to_activate = false; | 1237 did_notify_ready_to_activate = false; |
| 1239 ready_to_draw = false; | 1238 ready_to_draw = false; |
| 1240 did_notify_ready_to_draw = false; | 1239 did_notify_ready_to_draw = false; |
| 1241 all_tile_tasks_completed = false; | 1240 all_tile_tasks_completed = false; |
| 1242 did_notify_all_tile_tasks_completed = false; | 1241 did_notify_all_tile_tasks_completed = false; |
| 1243 } | 1242 } |
| 1244 | 1243 |
| 1245 } // namespace cc | 1244 } // namespace cc |
| OLD | NEW |