OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 WINDOW_MANAGER_COMPOSITOR_TEXTURE_DATA_H_ | 5 #ifndef WINDOW_MANAGER_COMPOSITOR_TEXTURE_DATA_H_ |
6 #define WINDOW_MANAGER_COMPOSITOR_TEXTURE_DATA_H_ | 6 #define WINDOW_MANAGER_COMPOSITOR_TEXTURE_DATA_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 namespace window_manager { | 10 namespace window_manager { |
9 | 11 |
10 class TextureData { | 12 class TextureData { |
11 public: | 13 public: |
12 virtual ~TextureData() {} | 14 virtual ~TextureData() {} |
13 GLuint texture() const { return texture_; } | 15 uint32_t texture() const { return texture_; } |
14 | 16 |
15 bool has_alpha() const { return has_alpha_; } | 17 bool has_alpha() const { return has_alpha_; } |
16 void set_has_alpha(bool has_alpha) { has_alpha_ = has_alpha; } | 18 void set_has_alpha(bool has_alpha) { has_alpha_ = has_alpha; } |
17 virtual void Refresh() {} | 19 virtual void Refresh() {} |
18 | 20 |
19 protected: | 21 protected: |
20 // TextureData is not allowed to be instantiated. | 22 // TextureData is not allowed to be instantiated. |
21 TextureData() : texture_(0), has_alpha_(true) {} | 23 TextureData() : texture_(0), has_alpha_(true) {} |
22 void set_texture(GLuint texture) { texture_ = texture; } | 24 void set_texture(uint32_t texture) { texture_ = texture; } |
23 const GLuint* texture_ptr() { return &texture_; } | 25 const uint32_t* texture_ptr() { return &texture_; } |
24 | 26 |
25 private: | 27 private: |
26 GLuint texture_; | 28 uint32_t texture_; |
27 bool has_alpha_; | 29 bool has_alpha_; |
28 DISALLOW_COPY_AND_ASSIGN(TextureData); | 30 DISALLOW_COPY_AND_ASSIGN(TextureData); |
29 }; | 31 }; |
30 | 32 |
31 } // namespace window_manager | 33 } // namespace window_manager |
32 | 34 |
33 #endif // WINDOW_MANAGER_COMPOSITOR_TEXTURE_DATA_H_ | 35 #endif // WINDOW_MANAGER_COMPOSITOR_TEXTURE_DATA_H_ |
OLD | NEW |