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

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

Issue 2945813002: cc: Interface to evict images from cc image decode cache. (Closed)
Patch Set: rebase Created 3 years, 6 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/tiles/software_image_decode_cache.h ('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 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 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 849
850 void SoftwareImageDecodeCache::ClearCache() { 850 void SoftwareImageDecodeCache::ClearCache() {
851 base::AutoLock lock(lock_); 851 base::AutoLock lock(lock_);
852 ReduceCacheUsageUntilWithinLimit(0); 852 ReduceCacheUsageUntilWithinLimit(0);
853 } 853 }
854 854
855 size_t SoftwareImageDecodeCache::GetMaximumMemoryLimitBytes() const { 855 size_t SoftwareImageDecodeCache::GetMaximumMemoryLimitBytes() const {
856 return locked_images_budget_.total_limit_bytes(); 856 return locked_images_budget_.total_limit_bytes();
857 } 857 }
858 858
859 void SoftwareImageDecodeCache::NotifyImageUnused(uint32_t skimage_id) {
860 // TODO(sohanjg) :Implement it, crbug.com/734982.
861 }
862
859 void SoftwareImageDecodeCache::RemovePendingTask(const ImageKey& key, 863 void SoftwareImageDecodeCache::RemovePendingTask(const ImageKey& key,
860 DecodeTaskType task_type) { 864 DecodeTaskType task_type) {
861 base::AutoLock lock(lock_); 865 base::AutoLock lock(lock_);
862 switch (task_type) { 866 switch (task_type) {
863 case DecodeTaskType::USE_IN_RASTER_TASKS: 867 case DecodeTaskType::USE_IN_RASTER_TASKS:
864 pending_in_raster_image_tasks_.erase(key); 868 pending_in_raster_image_tasks_.erase(key);
865 break; 869 break;
866 case DecodeTaskType::USE_OUT_OF_RASTER_TASKS: 870 case DecodeTaskType::USE_OUT_OF_RASTER_TASKS:
867 pending_out_of_raster_image_tasks_.erase(key); 871 pending_out_of_raster_image_tasks_.erase(key);
868 break; 872 break;
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 } 1205 }
1202 } 1206 }
1203 } 1207 }
1204 1208
1205 void SoftwareImageDecodeCache::OnPurgeMemory() { 1209 void SoftwareImageDecodeCache::OnPurgeMemory() {
1206 base::AutoLock lock(lock_); 1210 base::AutoLock lock(lock_);
1207 ReduceCacheUsageUntilWithinLimit(0); 1211 ReduceCacheUsageUntilWithinLimit(0);
1208 } 1212 }
1209 1213
1210 } // namespace cc 1214 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/software_image_decode_cache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698