| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "ui/gfx/gpu_memory_buffer.h" | 9 #include "ui/gfx/gpu_memory_buffer.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 12 #include "ui/gl/gl_export.h" | 12 #include "ui/gl/gl_export.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 | 15 |
| 16 class GLSurface; | 16 class GLSurface; |
| 17 | 17 |
| 18 // Encapsulates an image that can be bound to a texture, hiding platform | 18 // Encapsulates an image that can be bound to a texture, hiding platform |
| 19 // specific management. | 19 // specific management. |
| 20 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 20 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
| 21 public: | 21 public: |
| 22 GLImage(); | 22 GLImage(); |
| 23 | 23 |
| 24 // Destroys the image. | 24 // Destroys the image. |
| 25 virtual void Destroy() = 0; | 25 virtual void Destroy(bool have_context) = 0; |
| 26 | 26 |
| 27 // Get the size of the image. | 27 // Get the size of the image. |
| 28 virtual gfx::Size GetSize() = 0; | 28 virtual gfx::Size GetSize() = 0; |
| 29 | 29 |
| 30 // Bind image to texture currently bound to |target|. | 30 // Bind image to texture currently bound to |target|. |
| 31 virtual bool BindTexImage(unsigned target) = 0; | 31 virtual bool BindTexImage(unsigned target) = 0; |
| 32 | 32 |
| 33 // Release image from texture currently bound to |target|. | 33 // Release image from texture currently bound to |target|. |
| 34 virtual void ReleaseTexImage(unsigned target) = 0; | 34 virtual void ReleaseTexImage(unsigned target) = 0; |
| 35 | 35 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 friend class base::RefCounted<GLImage>; | 65 friend class base::RefCounted<GLImage>; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(GLImage); | 67 DISALLOW_COPY_AND_ASSIGN(GLImage); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace gfx | 70 } // namespace gfx |
| 71 | 71 |
| 72 #endif // UI_GL_GL_IMAGE_H_ | 72 #endif // UI_GL_GL_IMAGE_H_ |
| OLD | NEW |