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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Encapsulates an image that can be bound and/or copied to a texture, hiding | 27 // Encapsulates an image that can be bound and/or copied to a texture, hiding |
28 // platform specific management. | 28 // platform specific management. |
29 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 29 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
30 public: | 30 public: |
31 GLImage() {} | 31 GLImage() {} |
32 | 32 |
33 // Destroys the image. | 33 // Destroys the image. |
34 virtual void Destroy(bool have_context) = 0; | 34 virtual void Destroy(bool have_context) = 0; |
35 | 35 |
| 36 // Query the image status |
| 37 virtual bool IsValid() = 0; |
| 38 |
36 // Get the size of the image. | 39 // Get the size of the image. |
37 virtual gfx::Size GetSize() = 0; | 40 virtual gfx::Size GetSize() = 0; |
38 | 41 |
39 // Get the internal format of the image. | 42 // Get the internal format of the image. |
40 virtual unsigned GetInternalFormat() = 0; | 43 virtual unsigned GetInternalFormat() = 0; |
41 | 44 |
42 // Bind image to texture currently bound to |target|. Returns true on success. | 45 // Bind image to texture currently bound to |target|. Returns true on success. |
43 // It is valid for an implementation to always return false. | 46 // It is valid for an implementation to always return false. |
44 virtual bool BindTexImage(unsigned target) = 0; | 47 virtual bool BindTexImage(unsigned target) = 0; |
45 | 48 |
(...skipping 30 matching lines...) Expand all Loading... |
76 | 79 |
77 private: | 80 private: |
78 friend class base::RefCounted<GLImage>; | 81 friend class base::RefCounted<GLImage>; |
79 | 82 |
80 DISALLOW_COPY_AND_ASSIGN(GLImage); | 83 DISALLOW_COPY_AND_ASSIGN(GLImage); |
81 }; | 84 }; |
82 | 85 |
83 } // namespace gl | 86 } // namespace gl |
84 | 87 |
85 #endif // UI_GL_GL_IMAGE_H_ | 88 #endif // UI_GL_GL_IMAGE_H_ |
OLD | NEW |