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 #ifndef CC_TILES_IMAGE_DECODE_CONTROLLER_H_ | 5 #ifndef CC_TILES_IMAGE_DECODE_CONTROLLER_H_ |
6 #define CC_TILES_IMAGE_DECODE_CONTROLLER_H_ | 6 #define CC_TILES_IMAGE_DECODE_CONTROLLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include <unordered_map> |
| 11 |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
13 #include "cc/playback/discardable_image_map.h" | 14 #include "cc/playback/discardable_image_map.h" |
14 #include "cc/raster/tile_task_runner.h" | 15 #include "cc/raster/tile_task_runner.h" |
15 #include "skia/ext/refptr.h" | 16 #include "skia/ext/refptr.h" |
16 | 17 |
17 namespace cc { | 18 namespace cc { |
18 | 19 |
19 class ImageDecodeController { | 20 class ImageDecodeController { |
20 public: | 21 public: |
(...skipping 14 matching lines...) Expand all Loading... |
35 | 36 |
36 void OnImageDecodeTaskCompleted(int layer_id, | 37 void OnImageDecodeTaskCompleted(int layer_id, |
37 const SkImage* image, | 38 const SkImage* image, |
38 bool was_canceled); | 39 bool was_canceled); |
39 | 40 |
40 private: | 41 private: |
41 scoped_refptr<ImageDecodeTask> CreateTaskForImage(const SkImage* image, | 42 scoped_refptr<ImageDecodeTask> CreateTaskForImage(const SkImage* image, |
42 int layer_id, | 43 int layer_id, |
43 uint64_t prepare_tiles_id); | 44 uint64_t prepare_tiles_id); |
44 | 45 |
45 using ImageTaskMap = base::hash_map<uint32_t, scoped_refptr<ImageDecodeTask>>; | 46 using ImageTaskMap = |
46 using LayerImageTaskMap = base::hash_map<int, ImageTaskMap>; | 47 std::unordered_map<uint32_t, scoped_refptr<ImageDecodeTask>>; |
| 48 using LayerImageTaskMap = std::unordered_map<int, ImageTaskMap>; |
47 LayerImageTaskMap image_decode_tasks_; | 49 LayerImageTaskMap image_decode_tasks_; |
48 | 50 |
49 using LayerCountMap = base::hash_map<int, int>; | 51 using LayerCountMap = std::unordered_map<int, int>; |
50 LayerCountMap used_layer_counts_; | 52 LayerCountMap used_layer_counts_; |
51 }; | 53 }; |
52 | 54 |
53 } // namespace cc | 55 } // namespace cc |
54 | 56 |
55 #endif // CC_TILES_IMAGE_DECODE_CONTROLLER_H_ | 57 #endif // CC_TILES_IMAGE_DECODE_CONTROLLER_H_ |
OLD | NEW |