OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return (version - version_) < 0x80000000; | 54 return (version - version_) < 0x80000000; |
55 } | 55 } |
56 bool Matches(const Texture* texture) const; | 56 bool Matches(const Texture* texture) const; |
57 | 57 |
58 scoped_refptr<NativeImageBuffer> image() const { return image_buffer_; } | 58 scoped_refptr<NativeImageBuffer> image() const { return image_buffer_; } |
59 | 59 |
60 private: | 60 private: |
61 bool SafeToRenderFrom() const; | 61 bool SafeToRenderFrom() const; |
62 | 62 |
63 struct LevelInfo { | 63 struct LevelInfo { |
64 LevelInfo(); | |
65 LevelInfo(GLenum target, | 64 LevelInfo(GLenum target, |
66 GLenum internal_format, | 65 GLenum internal_format, |
67 GLsizei width, | 66 GLsizei width, |
68 GLsizei height, | 67 GLsizei height, |
69 GLsizei depth, | 68 GLsizei depth, |
70 GLint border, | 69 GLint border, |
71 GLenum format, | 70 GLenum format, |
72 GLenum type, | 71 GLenum type, |
73 bool cleared); | 72 bool cleared); |
74 ~LevelInfo(); | 73 ~LevelInfo(); |
75 | 74 |
76 GLenum target; | 75 GLenum target; |
77 GLenum internal_format; | 76 GLenum internal_format; |
78 GLsizei width; | 77 GLsizei width; |
79 GLsizei height; | 78 GLsizei height; |
80 GLsizei depth; | 79 GLsizei depth; |
81 GLint border; | 80 GLint border; |
82 GLenum format; | 81 GLenum format; |
83 GLenum type; | 82 GLenum type; |
84 bool cleared; | 83 bool cleared; |
85 }; | 84 }; |
86 | 85 |
| 86 typedef std::vector<std::vector<LevelInfo> > LevelInfos; |
| 87 |
87 unsigned int version_; | 88 unsigned int version_; |
88 GLenum target_; | 89 GLenum target_; |
89 scoped_refptr<NativeImageBuffer> image_buffer_; | 90 scoped_refptr<NativeImageBuffer> image_buffer_; |
90 GLenum min_filter_; | 91 GLenum min_filter_; |
91 GLenum mag_filter_; | 92 GLenum mag_filter_; |
92 GLenum wrap_s_; | 93 GLenum wrap_s_; |
93 GLenum wrap_t_; | 94 GLenum wrap_t_; |
94 GLenum usage_; | 95 GLenum usage_; |
95 bool immutable_; | 96 bool immutable_; |
96 bool defined_; | 97 LevelInfos level_infos_; |
97 | |
98 // Only support textures with one face and one level. | |
99 LevelInfo level_info_; | |
100 }; | 98 }; |
101 | 99 |
102 } // namespage gles2 | 100 } // namespage gles2 |
103 } // namespace gpu | 101 } // namespace gpu |
104 | 102 |
105 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 103 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
OLD | NEW |