OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 explicit TextureInfo(GLuint service_id) | 33 explicit TextureInfo(GLuint service_id) |
34 : service_id_(service_id), | 34 : service_id_(service_id), |
35 deleted_(false), | 35 deleted_(false), |
36 cleared_(true), | 36 cleared_(true), |
37 num_uncleared_mips_(0), | 37 num_uncleared_mips_(0), |
38 target_(0), | 38 target_(0), |
39 min_filter_(GL_NEAREST_MIPMAP_LINEAR), | 39 min_filter_(GL_NEAREST_MIPMAP_LINEAR), |
40 mag_filter_(GL_LINEAR), | 40 mag_filter_(GL_LINEAR), |
41 wrap_s_(GL_REPEAT), | 41 wrap_s_(GL_REPEAT), |
42 wrap_t_(GL_REPEAT), | 42 wrap_t_(GL_REPEAT), |
| 43 usage_(GL_NONE), |
43 max_level_set_(-1), | 44 max_level_set_(-1), |
44 texture_complete_(false), | 45 texture_complete_(false), |
45 cube_complete_(false), | 46 cube_complete_(false), |
46 npot_(false), | 47 npot_(false), |
47 has_been_bound_(false), | 48 has_been_bound_(false), |
48 framebuffer_attachment_count_(0), | 49 framebuffer_attachment_count_(0), |
49 owned_(true), | 50 owned_(true), |
50 stream_texture_(false) { | 51 stream_texture_(false) { |
51 } | 52 } |
52 | 53 |
53 GLenum min_filter() const { | 54 GLenum min_filter() const { |
54 return min_filter_; | 55 return min_filter_; |
55 } | 56 } |
56 | 57 |
57 GLenum mag_filter() const { | 58 GLenum mag_filter() const { |
58 return mag_filter_; | 59 return mag_filter_; |
59 } | 60 } |
60 | 61 |
61 GLenum wrap_s() const { | 62 GLenum wrap_s() const { |
62 return wrap_s_; | 63 return wrap_s_; |
63 } | 64 } |
64 | 65 |
65 GLenum wrap_t() const { | 66 GLenum wrap_t() const { |
66 return wrap_t_; | 67 return wrap_t_; |
67 } | 68 } |
68 | 69 |
| 70 GLenum usage() const { |
| 71 return usage_; |
| 72 } |
| 73 |
69 int num_uncleared_mips() const { | 74 int num_uncleared_mips() const { |
70 return num_uncleared_mips_; | 75 return num_uncleared_mips_; |
71 } | 76 } |
72 | 77 |
73 // True if this texture meets all the GLES2 criteria for rendering. | 78 // True if this texture meets all the GLES2 criteria for rendering. |
74 // See section 3.8.2 of the GLES2 spec. | 79 // See section 3.8.2 of the GLES2 spec. |
75 bool CanRender(const FeatureInfo* feature_info) const; | 80 bool CanRender(const FeatureInfo* feature_info) const; |
76 | 81 |
77 bool CanRenderTo() const { | 82 bool CanRenderTo() const { |
78 return !stream_texture_ && target_ != GL_TEXTURE_EXTERNAL_OES; | 83 return !stream_texture_ && target_ != GL_TEXTURE_EXTERNAL_OES; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 int num_uncleared_mips_; | 280 int num_uncleared_mips_; |
276 | 281 |
277 // The target. 0 if unset, otherwise GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. | 282 // The target. 0 if unset, otherwise GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP. |
278 GLenum target_; | 283 GLenum target_; |
279 | 284 |
280 // Texture parameters. | 285 // Texture parameters. |
281 GLenum min_filter_; | 286 GLenum min_filter_; |
282 GLenum mag_filter_; | 287 GLenum mag_filter_; |
283 GLenum wrap_s_; | 288 GLenum wrap_s_; |
284 GLenum wrap_t_; | 289 GLenum wrap_t_; |
| 290 GLenum usage_; |
285 | 291 |
286 // The maximum level that has been set. | 292 // The maximum level that has been set. |
287 GLint max_level_set_; | 293 GLint max_level_set_; |
288 | 294 |
289 // Whether or not this texture is "texture complete" | 295 // Whether or not this texture is "texture complete" |
290 bool texture_complete_; | 296 bool texture_complete_; |
291 | 297 |
292 // Whether or not this texture is "cube complete" | 298 // Whether or not this texture is "cube complete" |
293 bool cube_complete_; | 299 bool cube_complete_; |
294 | 300 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 TextureInfo::Ref default_texture_external_oes_; | 491 TextureInfo::Ref default_texture_external_oes_; |
486 TextureInfo::Ref default_texture_rectangle_arb_; | 492 TextureInfo::Ref default_texture_rectangle_arb_; |
487 | 493 |
488 DISALLOW_COPY_AND_ASSIGN(TextureManager); | 494 DISALLOW_COPY_AND_ASSIGN(TextureManager); |
489 }; | 495 }; |
490 | 496 |
491 } // namespace gles2 | 497 } // namespace gles2 |
492 } // namespace gpu | 498 } // namespace gpu |
493 | 499 |
494 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 500 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |