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_TEST_TEXTURE_H_ | 5 #ifndef CC_TEST_TEST_TEXTURE_H_ |
6 #define CC_TEST_TEST_TEXTURE_H_ | 6 #define CC_TEST_TEST_TEXTURE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include "base/containers/hash_tables.h" | 11 #include <unordered_map> |
| 12 |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "cc/resources/resource_format.h" | 15 #include "cc/resources/resource_format.h" |
15 #include "third_party/khronos/GLES2/gl2.h" | 16 #include "third_party/khronos/GLES2/gl2.h" |
16 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
17 | 18 |
18 namespace cc { | 19 namespace cc { |
19 | 20 |
20 size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format); | 21 size_t TextureSizeBytes(const gfx::Size& size, ResourceFormat format); |
21 | 22 |
22 struct TestTexture : public base::RefCounted<TestTexture> { | 23 struct TestTexture : public base::RefCounted<TestTexture> { |
23 TestTexture(); | 24 TestTexture(); |
24 | 25 |
25 void Reallocate(const gfx::Size& size, ResourceFormat format); | 26 void Reallocate(const gfx::Size& size, ResourceFormat format); |
26 bool IsValidParameter(GLenum pname); | 27 bool IsValidParameter(GLenum pname); |
27 | 28 |
28 gfx::Size size; | 29 gfx::Size size; |
29 ResourceFormat format; | 30 ResourceFormat format; |
30 scoped_ptr<uint8_t[]> data; | 31 scoped_ptr<uint8_t[]> data; |
31 | 32 |
32 typedef base::hash_map<GLenum, GLint> | 33 using TextureParametersMap = std::unordered_map<GLenum, GLint>; |
33 TextureParametersMap; | |
34 TextureParametersMap params; | 34 TextureParametersMap params; |
35 | 35 |
36 private: | 36 private: |
37 friend class base::RefCounted<TestTexture>; | 37 friend class base::RefCounted<TestTexture>; |
38 ~TestTexture(); | 38 ~TestTexture(); |
39 }; | 39 }; |
40 | 40 |
41 } // namespace cc | 41 } // namespace cc |
42 | 42 |
43 #endif // CC_TEST_TEST_TEXTURE_H_ | 43 #endif // CC_TEST_TEST_TEXTURE_H_ |
OLD | NEW |