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 UI_GL_GL_IMAGE_H_ | 5 #ifndef UI_GL_GL_IMAGE_H_ |
6 #define UI_GL_GL_IMAGE_H_ | 6 #define UI_GL_GL_IMAGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 15 matching lines...) Expand all Loading... |
26 } | 26 } |
27 | 27 |
28 namespace gl { | 28 namespace gl { |
29 | 29 |
30 // Encapsulates an image that can be bound and/or copied to a texture, hiding | 30 // Encapsulates an image that can be bound and/or copied to a texture, hiding |
31 // platform specific management. | 31 // platform specific management. |
32 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 32 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
33 public: | 33 public: |
34 GLImage() {} | 34 GLImage() {} |
35 | 35 |
36 // Destroys the image. | |
37 virtual void Destroy(bool have_context) = 0; | |
38 | |
39 // Get the size of the image. | 36 // Get the size of the image. |
40 virtual gfx::Size GetSize() = 0; | 37 virtual gfx::Size GetSize() = 0; |
41 | 38 |
42 // Get the internal format of the image. | 39 // Get the internal format of the image. |
43 virtual unsigned GetInternalFormat() = 0; | 40 virtual unsigned GetInternalFormat() = 0; |
44 | 41 |
45 // Bind image to texture currently bound to |target|. Returns true on success. | 42 // Bind image to texture currently bound to |target|. Returns true on success. |
46 // It is valid for an implementation to always return false. | 43 // It is valid for an implementation to always return false. |
47 virtual bool BindTexImage(unsigned target) = 0; | 44 virtual bool BindTexImage(unsigned target) = 0; |
48 | 45 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 97 |
101 private: | 98 private: |
102 friend class base::RefCounted<GLImage>; | 99 friend class base::RefCounted<GLImage>; |
103 | 100 |
104 DISALLOW_COPY_AND_ASSIGN(GLImage); | 101 DISALLOW_COPY_AND_ASSIGN(GLImage); |
105 }; | 102 }; |
106 | 103 |
107 } // namespace gl | 104 } // namespace gl |
108 | 105 |
109 #endif // UI_GL_GL_IMAGE_H_ | 106 #endif // UI_GL_GL_IMAGE_H_ |
OLD | NEW |