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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 SoftwareImageDecodeCache* cache_; | 90 SoftwareImageDecodeCache* cache_; |
91 const DrawImage& draw_image_; | 91 const DrawImage& draw_image_; |
92 const DecodedDrawImage& decoded_draw_image_; | 92 const DecodedDrawImage& decoded_draw_image_; |
93 }; | 93 }; |
94 | 94 |
95 class ImageDecodeTaskImpl : public TileTask { | 95 class ImageDecodeTaskImpl : public TileTask { |
96 public: | 96 public: |
97 ImageDecodeTaskImpl(SoftwareImageDecodeCache* cache, | 97 ImageDecodeTaskImpl(SoftwareImageDecodeCache* cache, |
98 const SoftwareImageDecodeCache::ImageKey& image_key, | 98 const SoftwareImageDecodeCache::ImageKey& image_key, |
99 const DrawImage& image, | 99 const DrawImage& image, |
100 const SoftwareImageDecodeCache::DecodeTaskType task_type, | 100 SoftwareImageDecodeCache::DecodeTaskType task_type, |
101 const ImageDecodeCache::TracingInfo& tracing_info) | 101 const ImageDecodeCache::TracingInfo& tracing_info) |
102 : TileTask(true), | 102 : TileTask(true), |
103 cache_(cache), | 103 cache_(cache), |
104 image_key_(image_key), | 104 image_key_(image_key), |
105 image_(image), | 105 image_(image), |
106 task_type_(task_type), | 106 task_type_(task_type), |
107 tracing_info_(tracing_info) {} | 107 tracing_info_(tracing_info) {} |
108 | 108 |
109 // Overridden from Task: | 109 // Overridden from Task: |
110 void RunOnWorkerThread() override { | 110 void RunOnWorkerThread() override { |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 } | 1177 } |
1178 } | 1178 } |
1179 } | 1179 } |
1180 | 1180 |
1181 void SoftwareImageDecodeCache::OnPurgeMemory() { | 1181 void SoftwareImageDecodeCache::OnPurgeMemory() { |
1182 base::AutoLock lock(lock_); | 1182 base::AutoLock lock(lock_); |
1183 ReduceCacheUsageUntilWithinLimit(0); | 1183 ReduceCacheUsageUntilWithinLimit(0); |
1184 } | 1184 } |
1185 | 1185 |
1186 } // namespace cc | 1186 } // namespace cc |
OLD | NEW |