| 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> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "ui/gfx/geometry/point.h" | 14 #include "ui/gfx/geometry/point.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 16 #include "ui/gfx/geometry/rect_f.h" | 16 #include "ui/gfx/geometry/rect_f.h" |
| 17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
| 18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 19 #include "ui/gfx/overlay_transform.h" | 19 #include "ui/gfx/overlay_transform.h" |
| 20 #include "ui/gl/gl_export.h" | 20 #include "ui/gl/gl_export.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 namespace trace_event { | 23 namespace trace_event { |
| 24 class ProcessMemoryDump; | 24 class ProcessMemoryDump; |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace gl { | 28 namespace gl { |
| 29 class GLFence; |
| 29 | 30 |
| 30 // Encapsulates an image that can be bound and/or copied to a texture, hiding | 31 // Encapsulates an image that can be bound and/or copied to a texture, hiding |
| 31 // platform specific management. | 32 // platform specific management. |
| 32 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 33 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
| 33 public: | 34 public: |
| 34 GLImage() {} | 35 GLImage() {} |
| 35 | 36 |
| 36 // Get the size of the image. | 37 // Get the size of the image. |
| 37 virtual gfx::Size GetSize() = 0; | 38 virtual gfx::Size GetSize() = 0; |
| 38 | 39 |
| 39 // Get the internal format of the image. | 40 // Get the internal format of the image. |
| 40 virtual unsigned GetInternalFormat() = 0; | 41 virtual unsigned GetInternalFormat() = 0; |
| 41 | 42 |
| 42 // Bind image to texture currently bound to |target|. Returns true on success. | 43 // Bind image to texture currently bound to |target|. Returns true on success. |
| 43 // It is valid for an implementation to always return false. | 44 // It is valid for an implementation to always return false. |
| 44 virtual bool BindTexImage(unsigned target) = 0; | 45 virtual bool BindTexImage(unsigned target, GLFence* fence) = 0; |
| 45 | 46 |
| 46 // Release image from texture currently bound to |target|. | 47 // Release image from texture currently bound to |target|. |
| 47 virtual void ReleaseTexImage(unsigned target) = 0; | 48 virtual void ReleaseTexImage(unsigned target) = 0; |
| 48 | 49 |
| 49 // Define texture currently bound to |target| by copying image into it. | 50 // Define texture currently bound to |target| by copying image into it. |
| 50 // Returns true on success. It is valid for an implementation to always | 51 // Returns true on success. It is valid for an implementation to always |
| 51 // return false. | 52 // return false. |
| 52 virtual bool CopyTexImage(unsigned target) = 0; | 53 virtual bool CopyTexImage(unsigned target) = 0; |
| 53 | 54 |
| 54 // Copy |rect| of image to |offset| in texture currently bound to |target|. | 55 // Copy |rect| of image to |offset| in texture currently bound to |target|. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 98 |
| 98 private: | 99 private: |
| 99 friend class base::RefCounted<GLImage>; | 100 friend class base::RefCounted<GLImage>; |
| 100 | 101 |
| 101 DISALLOW_COPY_AND_ASSIGN(GLImage); | 102 DISALLOW_COPY_AND_ASSIGN(GLImage); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace gl | 105 } // namespace gl |
| 105 | 106 |
| 106 #endif // UI_GL_GL_IMAGE_H_ | 107 #endif // UI_GL_GL_IMAGE_H_ |
| OLD | NEW |