OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "gpu/command_buffer/service/feature_info.h" | 13 #include "gpu/command_buffer/service/feature_info.h" |
14 #include "gpu/command_buffer/service/gl_utils.h" | 14 #include "gpu/command_buffer/service/gl_utils.h" |
15 #include "gpu/gpu_export.h" | |
16 | 15 |
17 namespace gpu { | 16 namespace gpu { |
18 namespace gles2 { | 17 namespace gles2 { |
19 | 18 |
20 class GLES2Decoder; | 19 class GLES2Decoder; |
21 | 20 |
22 // This class keeps track of the textures and their sizes so we can do NPOT and | 21 // This class keeps track of the textures and their sizes so we can do NPOT and |
23 // texture complete checking. | 22 // texture complete checking. |
24 // | 23 // |
25 // NOTE: To support shared resources an instance of this class will need to be | 24 // NOTE: To support shared resources an instance of this class will need to be |
26 // shared by multiple GLES2Decoders. | 25 // shared by multiple GLES2Decoders. |
27 class GPU_EXPORT TextureManager { | 26 class TextureManager { |
28 public: | 27 public: |
29 enum DefaultAndBlackTextures { | 28 enum DefaultAndBlackTextures { |
30 kTexture2D, | 29 kTexture2D, |
31 kCubeMap, | 30 kCubeMap, |
32 kExternalOES, | 31 kExternalOES, |
33 kRectangleARB, | 32 kRectangleARB, |
34 kNumDefaultTextures | 33 kNumDefaultTextures |
35 }; | 34 }; |
36 | 35 |
37 // Info about Textures currently in the system. | 36 // Info about Textures currently in the system. |
38 class GPU_EXPORT TextureInfo : public base::RefCounted<TextureInfo> { | 37 class TextureInfo : public base::RefCounted<TextureInfo> { |
39 public: | 38 public: |
40 typedef scoped_refptr<TextureInfo> Ref; | 39 typedef scoped_refptr<TextureInfo> Ref; |
41 | 40 |
42 TextureInfo(TextureManager* manager, GLuint service_id) | 41 TextureInfo(TextureManager* manager, GLuint service_id) |
43 : manager_(manager), | 42 : manager_(manager), |
44 service_id_(service_id), | 43 service_id_(service_id), |
45 deleted_(false), | 44 deleted_(false), |
46 cleared_(true), | 45 cleared_(true), |
47 num_uncleared_mips_(0), | 46 num_uncleared_mips_(0), |
48 target_(0), | 47 target_(0), |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 // The default textures for each target (texture name = 0) | 550 // The default textures for each target (texture name = 0) |
552 TextureInfo::Ref default_textures_[kNumDefaultTextures]; | 551 TextureInfo::Ref default_textures_[kNumDefaultTextures]; |
553 | 552 |
554 DISALLOW_COPY_AND_ASSIGN(TextureManager); | 553 DISALLOW_COPY_AND_ASSIGN(TextureManager); |
555 }; | 554 }; |
556 | 555 |
557 } // namespace gles2 | 556 } // namespace gles2 |
558 } // namespace gpu | 557 } // namespace gpu |
559 | 558 |
560 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 559 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |