cc: Move update tile priorities to PictureLayerTilingSet.
[chromium-blink-merge.git] / cc / test / ordered_texture_map.h
blob2aa311184a3a7c96c7f6b2ff4c455d392238b24d
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
3 // found in the LICENSE file.
5 #ifndef CC_TEST_ORDERED_TEXTURE_MAP_H_
6 #define CC_TEST_ORDERED_TEXTURE_MAP_H_
8 #include <vector>
10 #include "base/containers/hash_tables.h"
11 #include "base/memory/ref_counted.h"
12 #include "third_party/khronos/GLES2/gl2.h"
14 namespace cc {
16 struct TestTexture;
18 class OrderedTextureMap {
19 public:
20 OrderedTextureMap();
21 ~OrderedTextureMap();
23 void Append(GLuint id, scoped_refptr<TestTexture> texture);
24 void Replace(GLuint id, scoped_refptr<TestTexture> texture);
25 void Remove(GLuint id);
27 size_t Size();
29 bool ContainsId(GLuint id);
31 scoped_refptr<TestTexture> TextureForId(GLuint id);
32 GLuint IdAt(size_t index);
34 private:
35 typedef base::hash_map<GLuint, scoped_refptr<TestTexture>> TextureMap;
36 typedef std::vector<GLuint> TextureList;
38 TextureMap textures_;
39 TextureList ordered_textures_;
42 } // namespace cc
44 #endif // CC_TEST_ORDERED_TEXTURE_MAP_H_