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_DEBUG_ORDERED_TEXTURE_MAP_H_ | 5 #ifndef CC_TEST_ORDERED_TEXTURE_MAP_H_ |
6 #define CC_DEBUG_ORDERED_TEXTURE_MAP_H_ | 6 #define CC_TEST_ORDERED_TEXTURE_MAP_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "cc/base/cc_export.h" | |
13 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 12 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
14 | 13 |
15 namespace cc { | 14 namespace cc { |
16 | 15 |
17 struct TestTexture; | 16 struct TestTexture; |
18 | 17 |
19 class CC_EXPORT OrderedTextureMap { | 18 class OrderedTextureMap { |
20 public: | 19 public: |
21 OrderedTextureMap(); | 20 OrderedTextureMap(); |
22 ~OrderedTextureMap(); | 21 ~OrderedTextureMap(); |
23 | 22 |
24 void Append(WebKit::WebGLId id, scoped_refptr<TestTexture> texture); | 23 void Append(WebKit::WebGLId id, scoped_refptr<TestTexture> texture); |
25 void Replace(WebKit::WebGLId id, scoped_refptr<TestTexture> texture); | 24 void Replace(WebKit::WebGLId id, scoped_refptr<TestTexture> texture); |
26 void Remove(WebKit::WebGLId id); | 25 void Remove(WebKit::WebGLId id); |
27 | 26 |
28 size_t Size(); | 27 size_t Size(); |
29 | 28 |
30 bool ContainsId(WebKit::WebGLId id); | 29 bool ContainsId(WebKit::WebGLId id); |
31 | 30 |
32 scoped_refptr<TestTexture> TextureForId(WebKit::WebGLId id); | 31 scoped_refptr<TestTexture> TextureForId(WebKit::WebGLId id); |
33 WebKit::WebGLId IdAt(size_t index); | 32 WebKit::WebGLId IdAt(size_t index); |
34 | 33 |
35 private: | 34 private: |
36 typedef base::hash_map<WebKit::WebGLId, scoped_refptr<TestTexture> > | 35 typedef base::hash_map<WebKit::WebGLId, scoped_refptr<TestTexture> > |
37 TextureMap; | 36 TextureMap; |
38 typedef std::vector<WebKit::WebGLId> TextureList; | 37 typedef std::vector<WebKit::WebGLId> TextureList; |
39 | 38 |
40 TextureMap textures_; | 39 TextureMap textures_; |
41 TextureList ordered_textures_; | 40 TextureList ordered_textures_; |
42 }; | 41 }; |
43 | 42 |
44 } // namespace cc | 43 } // namespace cc |
45 | 44 |
46 #endif // CC_DEBUG_ORDERED_TEXTURE_MAP_H_ | 45 #endif // CC_TEST_ORDERED_TEXTURE_MAP_H_ |
OLD | NEW |