| 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(); |
| 64 LevelInfo(GLenum target, | 65 LevelInfo(GLenum target, |
| 65 GLenum internal_format, | 66 GLenum internal_format, |
| 66 GLsizei width, | 67 GLsizei width, |
| 67 GLsizei height, | 68 GLsizei height, |
| 68 GLsizei depth, | 69 GLsizei depth, |
| 69 GLint border, | 70 GLint border, |
| 70 GLenum format, | 71 GLenum format, |
| 71 GLenum type, | 72 GLenum type, |
| 72 bool cleared); | 73 bool cleared); |
| 73 ~LevelInfo(); | 74 ~LevelInfo(); |
| 74 | 75 |
| 75 GLenum target; | 76 GLenum target; |
| 76 GLenum internal_format; | 77 GLenum internal_format; |
| 77 GLsizei width; | 78 GLsizei width; |
| 78 GLsizei height; | 79 GLsizei height; |
| 79 GLsizei depth; | 80 GLsizei depth; |
| 80 GLint border; | 81 GLint border; |
| 81 GLenum format; | 82 GLenum format; |
| 82 GLenum type; | 83 GLenum type; |
| 83 bool cleared; | 84 bool cleared; |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 typedef std::vector<std::vector<LevelInfo> > LevelInfos; | |
| 87 | |
| 88 unsigned int version_; | 87 unsigned int version_; |
| 89 GLenum target_; | 88 GLenum target_; |
| 90 scoped_refptr<NativeImageBuffer> image_buffer_; | 89 scoped_refptr<NativeImageBuffer> image_buffer_; |
| 91 GLenum min_filter_; | 90 GLenum min_filter_; |
| 92 GLenum mag_filter_; | 91 GLenum mag_filter_; |
| 93 GLenum wrap_s_; | 92 GLenum wrap_s_; |
| 94 GLenum wrap_t_; | 93 GLenum wrap_t_; |
| 95 GLenum usage_; | 94 GLenum usage_; |
| 96 bool immutable_; | 95 bool immutable_; |
| 97 LevelInfos level_infos_; | 96 bool defined_; |
| 97 |
| 98 // Only support textures with one face and one level. |
| 99 LevelInfo level_info_; |
| 98 }; | 100 }; |
| 99 | 101 |
| 100 } // namespage gles2 | 102 } // namespage gles2 |
| 101 } // namespace gpu | 103 } // namespace gpu |
| 102 | 104 |
| 103 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ | 105 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_DEFINITION_H_ |
| OLD | NEW |