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

Unified Diff: cc/tiles/image_manager.cc

Issue 2345833002: cc: Move (partially) the predecode image tracking to ImageManager. (Closed)
Patch Set: update Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/tiles/image_manager.h ('k') | cc/tiles/image_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/image_manager.cc
diff --git a/cc/tiles/image_manager.cc b/cc/tiles/image_manager.cc
index cb11e9ec19266ae01c1577b07fb3b2dfe7e13996..2b08c2d8e4262df0901b4c524fa7c7ca2c54c3a9 100644
--- a/cc/tiles/image_manager.cc
+++ b/cc/tiles/image_manager.cc
@@ -10,6 +10,10 @@ ImageManager::ImageManager() = default;
ImageManager::~ImageManager() = default;
void ImageManager::SetImageDecodeController(ImageDecodeController* controller) {
+ if (!controller) {
enne (OOO) 2016/09/16 18:21:37 Sure, but do you also need to do this when the ima
vmpstr 2016/09/16 18:38:49 Well... I mean I can add a DCHECK, but normally if
+ SetPredecodeImages(std::vector<DrawImage>(),
+ ImageDecodeController::TracingInfo());
+ }
controller_ = controller;
}
@@ -43,4 +47,14 @@ void ImageManager::ReduceMemoryUsage() {
controller_->ReduceCacheUsage();
}
+std::vector<scoped_refptr<TileTask>> ImageManager::SetPredecodeImages(
+ std::vector<DrawImage> images,
+ const ImageDecodeController::TracingInfo& tracing_info) {
+ std::vector<scoped_refptr<TileTask>> new_tasks;
+ GetTasksForImagesAndRef(&images, &new_tasks, tracing_info);
+ UnrefImages(predecode_locked_images_);
+ predecode_locked_images_ = std::move(images);
+ return new_tasks;
+}
+
} // namespace cc
« no previous file with comments | « cc/tiles/image_manager.h ('k') | cc/tiles/image_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698