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

Side by Side Diff: cc/tiles/image_decode_controller.h

Issue 1610023003: Revert of Allow std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/surfaces/surface_sequence.h ('k') | chrome/browser/devtools/devtools_file_watcher.cc » ('j') | 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 #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 "base/containers/hash_tables.h"
11 #include "base/hash.h"
12 #include "base/memory/discardable_memory_allocator.h" 11 #include "base/memory/discardable_memory_allocator.h"
13 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
14 #include "base/numerics/safe_math.h" 13 #include "base/numerics/safe_math.h"
15 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
16 #include "cc/base/cc_export.h" 15 #include "cc/base/cc_export.h"
17 #include "cc/playback/decoded_draw_image.h" 16 #include "cc/playback/decoded_draw_image.h"
18 #include "cc/playback/draw_image.h" 17 #include "cc/playback/draw_image.h"
19 #include "cc/raster/tile_task_runner.h" 18 #include "cc/raster/tile_task_runner.h"
20 #include "skia/ext/refptr.h" 19 #include "skia/ext/refptr.h"
21 20
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } // namespace cc 72 } // namespace cc
74 73
75 // Hash function for the above ImageDecodeControllerKey. 74 // Hash function for the above ImageDecodeControllerKey.
76 namespace BASE_HASH_NAMESPACE { 75 namespace BASE_HASH_NAMESPACE {
77 template <> 76 template <>
78 struct hash<cc::ImageDecodeControllerKey> { 77 struct hash<cc::ImageDecodeControllerKey> {
79 size_t operator()(const cc::ImageDecodeControllerKey& key) const { 78 size_t operator()(const cc::ImageDecodeControllerKey& key) const {
80 // TODO(vmpstr): This is a mess. Maybe it's faster to just search the vector 79 // TODO(vmpstr): This is a mess. Maybe it's faster to just search the vector
81 // always (forwards or backwards to account for LRU). 80 // always (forwards or backwards to account for LRU).
82 uint64_t src_rect_hash = 81 uint64_t src_rect_hash =
83 base::HashInts(static_cast<uint64_t>(base::HashInts( 82 base::HashPair(static_cast<uint64_t>(base::HashPair(
84 key.src_rect().x(), key.src_rect().y())), 83 key.src_rect().x(), key.src_rect().y())),
85 static_cast<uint64_t>(base::HashInts( 84 static_cast<uint64_t>(base::HashPair(
86 key.src_rect().width(), key.src_rect().height()))); 85 key.src_rect().width(), key.src_rect().height())));
87 86
88 uint64_t target_size_hash = 87 uint64_t target_size_hash =
89 base::HashInts(key.target_size().width(), key.target_size().height()); 88 base::HashPair(key.target_size().width(), key.target_size().height());
90 89
91 return base::HashInts(base::HashInts(src_rect_hash, target_size_hash), 90 return base::HashPair(base::HashPair(src_rect_hash, target_size_hash),
92 base::HashInts(key.image_id(), key.filter_quality())); 91 base::HashPair(key.image_id(), key.filter_quality()));
93 } 92 }
94 }; 93 };
95 } // namespace BASE_HASH_NAMESPACE 94 } // namespace BASE_HASH_NAMESPACE
96 95
97 namespace cc { 96 namespace cc {
98 97
99 // ImageDecodeController is responsible for generating decode tasks, decoding 98 // ImageDecodeController is responsible for generating decode tasks, decoding
100 // images, storing images in cache, and being able to return the decoded images 99 // images, storing images in cache, and being able to return the decoded images
101 // when requested. 100 // when requested.
102 101
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 249
251 // Note that this is used for cases where the only thing we do is preroll the 250 // Note that this is used for cases where the only thing we do is preroll the
252 // image the first time we see it. This mimics the previous behavior and 251 // image the first time we see it. This mimics the previous behavior and
253 // should over time change as the compositor starts to handle more cases. 252 // should over time change as the compositor starts to handle more cases.
254 base::hash_set<uint32_t> prerolled_images_; 253 base::hash_set<uint32_t> prerolled_images_;
255 }; 254 };
256 255
257 } // namespace cc 256 } // namespace cc
258 257
259 #endif // CC_TILES_IMAGE_DECODE_CONTROLLER_H_ 258 #endif // CC_TILES_IMAGE_DECODE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « cc/surfaces/surface_sequence.h ('k') | chrome/browser/devtools/devtools_file_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698