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

Side by Side Diff: cc/test/ordered_texture_map.h

Issue 1587283002: Switch cc to std::unordered_*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unordered-map
Patch Set: Fix MSVC build issue 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/test/fake_ui_resource_layer_tree_host_impl.h ('k') | cc/test/test_texture.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TEST_ORDERED_TEXTURE_MAP_H_ 5 #ifndef CC_TEST_ORDERED_TEXTURE_MAP_H_
6 #define CC_TEST_ORDERED_TEXTURE_MAP_H_ 6 #define CC_TEST_ORDERED_TEXTURE_MAP_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <unordered_map>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/containers/hash_tables.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "third_party/khronos/GLES2/gl2.h" 14 #include "third_party/khronos/GLES2/gl2.h"
15 15
16 namespace cc { 16 namespace cc {
17 17
18 struct TestTexture; 18 struct TestTexture;
19 19
20 class OrderedTextureMap { 20 class OrderedTextureMap {
21 public: 21 public:
22 OrderedTextureMap(); 22 OrderedTextureMap();
23 ~OrderedTextureMap(); 23 ~OrderedTextureMap();
24 24
25 void Append(GLuint id, scoped_refptr<TestTexture> texture); 25 void Append(GLuint id, scoped_refptr<TestTexture> texture);
26 void Replace(GLuint id, scoped_refptr<TestTexture> texture); 26 void Replace(GLuint id, scoped_refptr<TestTexture> texture);
27 void Remove(GLuint id); 27 void Remove(GLuint id);
28 28
29 size_t Size(); 29 size_t Size();
30 30
31 bool ContainsId(GLuint id); 31 bool ContainsId(GLuint id);
32 32
33 scoped_refptr<TestTexture> TextureForId(GLuint id); 33 scoped_refptr<TestTexture> TextureForId(GLuint id);
34 GLuint IdAt(size_t index); 34 GLuint IdAt(size_t index);
35 35
36 private: 36 private:
37 typedef base::hash_map<GLuint, scoped_refptr<TestTexture>> TextureMap; 37 using TextureMap = std::unordered_map<GLuint, scoped_refptr<TestTexture>>;
38 typedef std::vector<GLuint> TextureList; 38 using TextureList = std::vector<GLuint>;
39 39
40 TextureMap textures_; 40 TextureMap textures_;
41 TextureList ordered_textures_; 41 TextureList ordered_textures_;
42 }; 42 };
43 43
44 } // namespace cc 44 } // namespace cc
45 45
46 #endif // CC_TEST_ORDERED_TEXTURE_MAP_H_ 46 #endif // CC_TEST_ORDERED_TEXTURE_MAP_H_
OLDNEW
« no previous file with comments | « cc/test/fake_ui_resource_layer_tree_host_impl.h ('k') | cc/test/test_texture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698