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 25 matching lines...) Expand all Loading... |
36 // Get the size of the image. | 36 // Get the size of the image. |
37 virtual gfx::Size GetSize() = 0; | 37 virtual gfx::Size GetSize() = 0; |
38 | 38 |
39 // Get the internal format of the image. | 39 // Get the internal format of the image. |
40 virtual unsigned GetInternalFormat() = 0; | 40 virtual unsigned GetInternalFormat() = 0; |
41 | 41 |
42 // 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. |
43 // It is valid for an implementation to always return false. | 43 // It is valid for an implementation to always return false. |
44 virtual bool BindTexImage(unsigned target) = 0; | 44 virtual bool BindTexImage(unsigned target) = 0; |
45 | 45 |
| 46 // Bind image to texture currently bound to |target|, forcing the texture's |
| 47 // internal format to the specified one. This is a feature not available on |
| 48 // all platforms. Returns true on success. It is valid for an implementation |
| 49 // to always return false. |
| 50 virtual bool BindTexImageWithInternalformat(unsigned target, |
| 51 unsigned internalformat); |
| 52 |
46 // Release image from texture currently bound to |target|. | 53 // Release image from texture currently bound to |target|. |
47 virtual void ReleaseTexImage(unsigned target) = 0; | 54 virtual void ReleaseTexImage(unsigned target) = 0; |
48 | 55 |
49 // Define texture currently bound to |target| by copying image into it. | 56 // Define texture currently bound to |target| by copying image into it. |
50 // Returns true on success. It is valid for an implementation to always | 57 // Returns true on success. It is valid for an implementation to always |
51 // return false. | 58 // return false. |
52 virtual bool CopyTexImage(unsigned target) = 0; | 59 virtual bool CopyTexImage(unsigned target) = 0; |
53 | 60 |
54 // Copy |rect| of image to |offset| in texture currently bound to |target|. | 61 // Copy |rect| of image to |offset| in texture currently bound to |target|. |
55 // Returns true on success. It is valid for an implementation to always | 62 // Returns true on success. It is valid for an implementation to always |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 101 |
95 private: | 102 private: |
96 friend class base::RefCounted<GLImage>; | 103 friend class base::RefCounted<GLImage>; |
97 | 104 |
98 DISALLOW_COPY_AND_ASSIGN(GLImage); | 105 DISALLOW_COPY_AND_ASSIGN(GLImage); |
99 }; | 106 }; |
100 | 107 |
101 } // namespace gl | 108 } // namespace gl |
102 | 109 |
103 #endif // UI_GL_GL_IMAGE_H_ | 110 #endif // UI_GL_GL_IMAGE_H_ |
OLD | NEW |