| 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_CONTROLLER_H_ | 5 #ifndef CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_ |
| 6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_ | 6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_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/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/numerics/safe_math.h" | 19 #include "base/numerics/safe_math.h" |
| 20 #include "base/threading/thread_checker.h" | 20 #include "base/threading/thread_checker.h" |
| 21 #include "base/trace_event/memory_dump_provider.h" | 21 #include "base/trace_event/memory_dump_provider.h" |
| 22 #include "cc/base/cc_export.h" | 22 #include "cc/base/cc_export.h" |
| 23 #include "cc/playback/decoded_draw_image.h" | 23 #include "cc/playback/decoded_draw_image.h" |
| 24 #include "cc/playback/draw_image.h" | 24 #include "cc/playback/draw_image.h" |
| 25 #include "cc/resources/resource_format.h" | 25 #include "cc/resources/resource_format.h" |
| 26 #include "cc/tiles/image_decode_controller.h" | 26 #include "cc/tiles/image_decode_controller.h" |
| 27 #include "third_party/skia/include/core/SkRefCnt.h" | 27 #include "third_party/skia/include/core/SkRefCnt.h" |
| 28 #include "ui/gfx/geometry/rect.h" |
| 28 | 29 |
| 29 namespace cc { | 30 namespace cc { |
| 30 | 31 |
| 31 // ImageDecodeControllerKey is a class that gets a cache key out of a given draw | 32 // ImageDecodeControllerKey is a class that gets a cache key out of a given draw |
| 32 // image. That is, this key uniquely identifies an image in the cache. Note that | 33 // image. That is, this key uniquely identifies an image in the cache. Note that |
| 33 // it's insufficient to use SkImage's unique id, since the same image can appear | 34 // it's insufficient to use SkImage's unique id, since the same image can appear |
| 34 // in the cache multiple times at different scales and filter qualities. | 35 // in the cache multiple times at different scales and filter qualities. |
| 35 class CC_EXPORT ImageDecodeControllerKey { | 36 class CC_EXPORT ImageDecodeControllerKey { |
| 36 public: | 37 public: |
| 37 static ImageDecodeControllerKey FromDrawImage(const DrawImage& image); | 38 static ImageDecodeControllerKey FromDrawImage(const DrawImage& image); |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 284 |
| 284 ResourceFormat format_; | 285 ResourceFormat format_; |
| 285 | 286 |
| 286 // Used to uniquely identify DecodedImages for memory traces. | 287 // Used to uniquely identify DecodedImages for memory traces. |
| 287 base::AtomicSequenceNumber next_tracing_id_; | 288 base::AtomicSequenceNumber next_tracing_id_; |
| 288 }; | 289 }; |
| 289 | 290 |
| 290 } // namespace cc | 291 } // namespace cc |
| 291 | 292 |
| 292 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_ | 293 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CONTROLLER_H_ |
| OLD | NEW |