Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/software_image_decode_cache.h" | 5 #include "cc/tiles/software_image_decode_cache.h" |
| 6 | 6 |
| 7 #include <inttypes.h> | 7 #include <inttypes.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 | 846 |
| 847 void SoftwareImageDecodeCache::ClearCache() { | 847 void SoftwareImageDecodeCache::ClearCache() { |
| 848 base::AutoLock lock(lock_); | 848 base::AutoLock lock(lock_); |
| 849 ReduceCacheUsageUntilWithinLimit(0); | 849 ReduceCacheUsageUntilWithinLimit(0); |
| 850 } | 850 } |
| 851 | 851 |
| 852 size_t SoftwareImageDecodeCache::GetMaximumMemoryLimitBytes() const { | 852 size_t SoftwareImageDecodeCache::GetMaximumMemoryLimitBytes() const { |
| 853 return locked_images_budget_.total_limit_bytes(); | 853 return locked_images_budget_.total_limit_bytes(); |
| 854 } | 854 } |
| 855 | 855 |
| 856 void SoftwareImageDecodeCache::NotifyImageUnused(uint32_t skimage_id) { | |
| 857 // TODO(sohanjg) :Implement it. | |
|
vmpstr
2017/06/19 16:34:42
Can you reference a bug here?
sohan
2017/06/20 13:31:39
Done.
| |
| 858 } | |
| 859 | |
| 856 void SoftwareImageDecodeCache::RemovePendingTask(const ImageKey& key, | 860 void SoftwareImageDecodeCache::RemovePendingTask(const ImageKey& key, |
| 857 DecodeTaskType task_type) { | 861 DecodeTaskType task_type) { |
| 858 base::AutoLock lock(lock_); | 862 base::AutoLock lock(lock_); |
| 859 switch (task_type) { | 863 switch (task_type) { |
| 860 case DecodeTaskType::USE_IN_RASTER_TASKS: | 864 case DecodeTaskType::USE_IN_RASTER_TASKS: |
| 861 pending_in_raster_image_tasks_.erase(key); | 865 pending_in_raster_image_tasks_.erase(key); |
| 862 break; | 866 break; |
| 863 case DecodeTaskType::USE_OUT_OF_RASTER_TASKS: | 867 case DecodeTaskType::USE_OUT_OF_RASTER_TASKS: |
| 864 pending_out_of_raster_image_tasks_.erase(key); | 868 pending_out_of_raster_image_tasks_.erase(key); |
| 865 break; | 869 break; |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1194 } | 1198 } |
| 1195 } | 1199 } |
| 1196 } | 1200 } |
| 1197 | 1201 |
| 1198 void SoftwareImageDecodeCache::OnPurgeMemory() { | 1202 void SoftwareImageDecodeCache::OnPurgeMemory() { |
| 1199 base::AutoLock lock(lock_); | 1203 base::AutoLock lock(lock_); |
| 1200 ReduceCacheUsageUntilWithinLimit(0); | 1204 ReduceCacheUsageUntilWithinLimit(0); |
| 1201 } | 1205 } |
| 1202 | 1206 |
| 1203 } // namespace cc | 1207 } // namespace cc |
| OLD | NEW |