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 #ifndef CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ | 5 #ifndef CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ |
6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ | 6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <unordered_map> | 11 #include <unordered_map> |
12 #include <unordered_set> | 12 #include <unordered_set> |
13 | 13 |
14 #include "base/atomic_sequence_num.h" | 14 #include "base/atomic_sequence_num.h" |
15 #include "base/containers/mru_cache.h" | 15 #include "base/containers/mru_cache.h" |
16 #include "base/hash.h" | 16 #include "base/hash.h" |
17 #include "base/memory/discardable_memory_allocator.h" | 17 #include "base/memory/discardable_memory_allocator.h" |
18 #include "base/memory/memory_coordinator_client.h" | 18 #include "base/memory/memory_coordinator_client.h" |
19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "base/numerics/safe_math.h" | 20 #include "base/numerics/safe_math.h" |
21 #include "base/threading/thread_checker.h" | 21 #include "base/threading/thread_checker.h" |
22 #include "base/trace_event/memory_dump_provider.h" | 22 #include "base/trace_event/memory_dump_provider.h" |
23 #include "cc/base/cc_export.h" | 23 #include "cc/cc_export.h" |
24 #include "cc/playback/decoded_draw_image.h" | 24 #include "cc/paint/draw_image.h" |
25 #include "cc/playback/draw_image.h" | |
26 #include "cc/resources/resource_format.h" | 25 #include "cc/resources/resource_format.h" |
| 26 #include "cc/tiles/decoded_draw_image.h" |
27 #include "cc/tiles/image_decode_cache.h" | 27 #include "cc/tiles/image_decode_cache.h" |
28 #include "third_party/skia/include/core/SkRefCnt.h" | 28 #include "third_party/skia/include/core/SkRefCnt.h" |
29 #include "ui/gfx/geometry/rect.h" | 29 #include "ui/gfx/geometry/rect.h" |
30 | 30 |
31 namespace cc { | 31 namespace cc { |
32 | 32 |
33 // ImageDecodeCacheKey is a class that gets a cache key out of a given draw | 33 // ImageDecodeCacheKey is a class that gets a cache key out of a given draw |
34 // image. That is, this key uniquely identifies an image in the cache. Note that | 34 // image. That is, this key uniquely identifies an image in the cache. Note that |
35 // it's insufficient to use SkImage's unique id, since the same image can appear | 35 // it's insufficient to use SkImage's unique id, since the same image can appear |
36 // in the cache multiple times at different scales and filter qualities. | 36 // in the cache multiple times at different scales and filter qualities. |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 ResourceFormat format_; | 309 ResourceFormat format_; |
310 size_t max_items_in_cache_; | 310 size_t max_items_in_cache_; |
311 | 311 |
312 // Used to uniquely identify DecodedImages for memory traces. | 312 // Used to uniquely identify DecodedImages for memory traces. |
313 base::AtomicSequenceNumber next_tracing_id_; | 313 base::AtomicSequenceNumber next_tracing_id_; |
314 }; | 314 }; |
315 | 315 |
316 } // namespace cc | 316 } // namespace cc |
317 | 317 |
318 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ | 318 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ |
OLD | NEW |