Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/image_controller.h" | 5 #include "cc/tiles/image_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/task_scheduler/post_task.h" | 8 #include "base/task_scheduler/post_task.h" |
| 9 #include "base/task_scheduler/task_traits.h" | 9 #include "base/task_scheduler/task_traits.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 DCHECK(!cache_ || !cache); | 124 DCHECK(!cache_ || !cache); |
| 125 | 125 |
| 126 if (!cache) { | 126 if (!cache) { |
| 127 SetPredecodeImages(std::vector<DrawImage>(), | 127 SetPredecodeImages(std::vector<DrawImage>(), |
| 128 ImageDecodeCache::TracingInfo()); | 128 ImageDecodeCache::TracingInfo()); |
| 129 StopWorkerTasks(); | 129 StopWorkerTasks(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 cache_ = cache; | 132 cache_ = cache; |
| 133 | 133 |
| 134 if (cache_) | 134 if (cache_) { |
| 135 image_cache_max_limit_bytes_ = cache_->GetMaximumMemoryLimit(); | |
|
Khushal
2017/04/28 00:12:53
Reset this in !cache above?
vmpstr
2017/04/28 17:18:30
Done.
| |
| 135 GenerateTasksForOrphanedRequests(); | 136 GenerateTasksForOrphanedRequests(); |
| 137 } | |
| 136 } | 138 } |
| 137 | 139 |
| 138 void ImageController::GetTasksForImagesAndRef( | 140 void ImageController::GetTasksForImagesAndRef( |
| 139 std::vector<DrawImage>* images, | 141 std::vector<DrawImage>* images, |
| 140 std::vector<scoped_refptr<TileTask>>* tasks, | 142 std::vector<scoped_refptr<TileTask>>* tasks, |
| 141 const ImageDecodeCache::TracingInfo& tracing_info) { | 143 const ImageDecodeCache::TracingInfo& tracing_info) { |
| 142 DCHECK(cache_); | 144 DCHECK(cache_); |
| 143 for (auto it = images->begin(); it != images->end();) { | 145 for (auto it = images->begin(); it != images->end();) { |
| 144 scoped_refptr<TileTask> task; | 146 scoped_refptr<TileTask> task; |
| 145 bool need_to_unref_when_finished = | 147 bool need_to_unref_when_finished = |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 ImageController::ImageDecodeRequest::ImageDecodeRequest( | 373 ImageController::ImageDecodeRequest::ImageDecodeRequest( |
| 372 const ImageDecodeRequest& other) = default; | 374 const ImageDecodeRequest& other) = default; |
| 373 ImageController::ImageDecodeRequest::~ImageDecodeRequest() = default; | 375 ImageController::ImageDecodeRequest::~ImageDecodeRequest() = default; |
| 374 | 376 |
| 375 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: | 377 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: |
| 376 operator=(ImageDecodeRequest&& other) = default; | 378 operator=(ImageDecodeRequest&& other) = default; |
| 377 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: | 379 ImageController::ImageDecodeRequest& ImageController::ImageDecodeRequest:: |
| 378 operator=(const ImageDecodeRequest& other) = default; | 380 operator=(const ImageDecodeRequest& other) = default; |
| 379 | 381 |
| 380 } // namespace cc | 382 } // namespace cc |
| OLD | NEW |