Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Side by Side Diff: cc/tiles/tile_manager.cc

Issue 1892573003: cc: Disable image hijack canvas when tiles don't have images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/playback/raster_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/playback/raster_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698