| 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/size.h" | 9 #include "ui/gfx/size.h" |
| 10 #include "ui/gl/gl_export.h" | 10 #include "ui/gl/gl_export.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 | 13 |
| 14 // Encapsulates an image that can be bound to a texture, hiding platform | 14 // Encapsulates an image that can be bound to a texture, hiding platform |
| 15 // specific management. | 15 // specific management. |
| 16 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 16 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
| 17 public: | 17 public: |
| 18 GLImage(); | 18 GLImage(); |
| 19 | 19 |
| 20 // Destroys the image. | 20 // Destroys the image. |
| 21 virtual void Destroy() = 0; | 21 virtual void Destroy(bool have_context) = 0; |
| 22 | 22 |
| 23 // Get the size of the image. | 23 // Get the size of the image. |
| 24 virtual gfx::Size GetSize() = 0; | 24 virtual gfx::Size GetSize() = 0; |
| 25 | 25 |
| 26 // Bind image to texture currently bound to |target|. | 26 // Bind image to texture currently bound to |target|. |
| 27 virtual bool BindTexImage(unsigned target) = 0; | 27 virtual bool BindTexImage(unsigned target) = 0; |
| 28 | 28 |
| 29 // Release image from texture currently bound to |target|. | 29 // Release image from texture currently bound to |target|. |
| 30 virtual void ReleaseTexImage(unsigned target) = 0; | 30 virtual void ReleaseTexImage(unsigned target) = 0; |
| 31 | 31 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 friend class base::RefCounted<GLImage>; | 52 friend class base::RefCounted<GLImage>; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(GLImage); | 54 DISALLOW_COPY_AND_ASSIGN(GLImage); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace gfx | 57 } // namespace gfx |
| 58 | 58 |
| 59 #endif // UI_GL_GL_IMAGE_H_ | 59 #endif // UI_GL_GL_IMAGE_H_ |
| OLD | NEW |