| OLD | NEW |
| 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_ |
| OLD | NEW |