Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 Name | 1 Name |
| 2 | 2 |
| 3 CHROMIUM_copy_texture | 3 CHROMIUM_copy_texture |
| 4 | 4 |
| 5 Name Strings | 5 Name Strings |
| 6 | 6 |
| 7 GL_CHROMIUM_copy_texture | 7 GL_CHROMIUM_copy_texture |
| 8 | 8 |
| 9 Version | 9 Version |
| 10 | 10 |
| 11 Last Modifed Date: July 16, 2014 | 11 Last Modifed Date: July 16, 2014 |
| 12 | 12 |
| 13 Dependencies | 13 Dependencies |
| 14 | 14 |
| 15 OpenGL ES 2.0 is required. | 15 OpenGL ES 2.0 or OpenGL ES 3.0 is required. |
| 16 | 16 |
| 17 EXT_texture_format_BGRA8888 affects the definition of this extension. | 17 EXT_texture_format_BGRA8888 affects the definition of this extension. |
| 18 ARB_texture_rg affects the definition of this extension. | 18 ARB_texture_rg affects the definition of this extension. |
| 19 CHROMIUM_ycbcr_422_image affects the definition of this extension. | 19 CHROMIUM_ycbcr_422_image affects the definition of this extension. |
| 20 | 20 |
| 21 Overview | 21 Overview |
| 22 | 22 |
| 23 This extension expands on the functionality provided by the | 23 This extension expands on the functionality provided by the |
| 24 glCopyTexImage2D command. A new function is exported, | 24 glCopyTexImage2D command. A new function is exported, |
| 25 glCopyTextureCHROMIUM, that performs the same copy operation as | 25 glCopyTextureCHROMIUM, that performs the same copy operation as |
| 26 glCopyTexImage2D. | 26 glCopyTexImage2D. |
| 27 | 27 |
| 28 The extension also supports copying BGRA textures and copying | 28 The extension also supports copying BGRA textures and copying |
| 29 EXTERNAL_OES texture to BGRA texture, which is not explicitly | 29 EXTERNAL_OES texture to BGRA texture, which is not explicitly |
| 30 granted by EXT_texture_format_BGRA8888. | 30 granted by EXT_texture_format_BGRA8888. |
| 31 | 31 |
| 32 New Procedures and Functions | 32 New Procedures and Functions |
| 33 | 33 |
| 34 The command | 34 The command |
| 35 | 35 |
| 36 void glCopyTextureCHROMIUM (GLenum source_id, | 36 void glCopyTextureCHROMIUM (GLenum source_id, |
| 37 GLint source_level, | |
| 38 GLenum dest_target, | |
| 37 GLenum dest_id, | 39 GLenum dest_id, |
| 40 GLint dest_level, | |
| 38 GLint internal_format, GLenum dest_type, | 41 GLint internal_format, GLenum dest_type, |
| 39 GLboolean unpack_flip_y, | 42 GLboolean unpack_flip_y, |
| 40 GLboolean unpack_premultiply_alpha, | 43 GLboolean unpack_premultiply_alpha, |
| 41 GLboolean unpack_unmultiply_alpha) | 44 GLboolean unpack_unmultiply_alpha) |
| 42 | 45 |
| 43 Copies the contents of <source_id> texture to <dest_id> texture. | 46 Copies the contents of <source_id> texture to <dest_id> texture. |
| 44 | 47 |
| 45 Texture level 0 is copied from the source image to level 0 of the | 48 <source_level> specifies the level of the source texture which is copied |
| 46 destination texture. | 49 from. |
| 50 <dest_level> specifies the level of the destination texture which is copied | |
| 51 to. | |
| 52 | |
| 53 <dest_target> specifies the target of destination texture. Must be | |
| 54 GL_TEXTURE_2D, | |
| 55 GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, | |
| 56 GL_TEXTURE_CUBE_MAP_POSITIVE_Y, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, | |
| 57 GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, | |
| 58 GL_TEXTURE_RECTANGLE_ARB. | |
| 47 | 59 |
| 48 The internal format of the destination texture is converted to that | 60 The internal format of the destination texture is converted to that |
| 49 specified by <internal_format>. Must be one of the following symbolic | 61 specified by <internal_format>. Must be one of the following symbolic |
| 50 constants: GL_RGB, GL_RGBA | 62 constants: GL_RGB, GL_RGBA, GL_RGB8, GL_RGBA8, GL_BGRA_EXT, GL_BGRA8_EXT, |
| 51 The internal format of <source_id> texture must be one of the following | 63 GL_SRGB_EXT, GL_SRGB_ALPHA_EXT, GL_R8, GL_R8UI, GL_RG8, GL_RG8UI, GL_SRGB8, |
| 52 symbolic constants: GL_R8, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, | 64 GL_RGB565, GL_RGB8UI, GL_SRGB8_ALPHA8, GL_RGB5_A1, GL_RGBA4, GL_RGBA4, |
| 53 GL_RGB, GL_RGBA, GL_BGRA_EXT, GL_RGB_YCBCR_422_CHROMIUM | 65 GL_RGBA8UI, GL_RGB9_E5, GL_R16F, GL_R32F, GL_RG16F, GL_RG32F, GL_RGB16F, |
| 54 When <source_id> texture doens't contain a superset of the component | 66 GL_RGB32F, GL_RGBA16F, GL_RGBA32F, GL_R11F_G11F_B10F. |
| 67 The internal format of source texture must be one of the following | |
| 68 symbolic constants: GL_RED, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, | |
| 69 GL_RGB, GL_RGBA, GL_RGB8, GL_RGBA8, GL_BGRA_EXT, GL_BGRA8_EXT, | |
| 70 GL_RGB_YCBCR_420V_CHROMIUM, GL_RGB_YCBCR_422_CHROMIUM. | |
| 71 When source texture doens't contain a superset of the component | |
| 55 required by <internal_format>, fill the components by following rules. | 72 required by <internal_format>, fill the components by following rules. |
| 56 | 73 |
| 57 source format color components | 74 source format color components |
| 58 ===================================================== | 75 ===================================================== |
| 59 GL_ALPHA (0, 0, 0, A) | 76 GL_ALPHA (0, 0, 0, A) |
| 60 GL_R8 (R, 0, 0, 1) | 77 GL_RED (R, 0, 0, 1) |
| 61 GL_LUMINANCE (L, L, L, 1) | 78 GL_LUMINANCE (L, L, L, 1) |
| 62 GL_LUMINANCE_ALPHA (L, L, L, A) | 79 GL_LUMINANCE_ALPHA (L, L, L, A) |
| 63 GL_RGB (R, G, B, 1) | 80 GL_RGB (R, G, B, 1) |
| 81 GL_RGB8 (R, G, B, 1) | |
| 64 GL_RGBA (R, G, B, A) | 82 GL_RGBA (R, G, B, A) |
| 83 GL_RGBA8 (R, G, B, A) | |
| 65 GL_BGRA_EXT (R, G, B, A) | 84 GL_BGRA_EXT (R, G, B, A) |
| 85 GL_BGRA8_EXT (R, G, B, A) | |
| 86 GL_RGB_YCBCR_420V_CHROMIUM (R, G, B, 1) | |
| 66 GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1) | 87 GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1) |
| 67 | 88 |
| 68 The format type of the destination texture is converted to that specified | 89 The format type of the destination texture is converted to that specified |
| 69 by <dest_type>. | 90 by <dest_type>. |
| 70 | 91 |
| 71 If <flip_y> is true, vertically flip texture image data. | 92 If <flip_y> is true, vertically flip texture image data. |
| 72 | 93 |
| 73 If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true, | 94 If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true, |
| 74 no alpha processing occurs. This is the equivalent of having neither flag | 95 no alpha processing occurs. This is the equivalent of having neither flag |
| 75 set. | 96 set. |
| 76 | 97 |
| 77 When <source_id> refers to a stream texture, the texture matrix will be | 98 When <source_id> refers to a stream texture, the texture matrix will be |
| 78 applied as part of the copy operation. | 99 applied as part of the copy operation. |
| 79 | 100 |
| 80 INVALID_OPERATION is generated if <internal_format> is not one of the valid formats | 101 INVALID_OPERATION is generated if <internal_format> is not one of the valid |
| 81 described above. | 102 formats described above. |
| 82 | 103 |
| 83 INVALID_OPERATION is generated if the internal format of <source_id> is not one of | 104 INVALID_OPERATION is generated if the internal format of <source_id> is not |
| 84 formats from the table above. | 105 one of formats from the table above. |
| 85 | 106 |
| 86 INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture | 107 INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture |
| 87 objects. | 108 objects. |
| 88 | 109 |
| 110 INVALID_ENUM is generated if <dest_target> is not one of the valid targets | |
| 111 described above. | |
| 112 | |
| 113 INVALID_OPERATION is generated if the bound target of destination texture | |
| 114 does not match <target>. | |
| 115 | |
| 89 INVALID_VALUE is generated if textures corresponding to <dest_id> have not | 116 INVALID_VALUE is generated if textures corresponding to <dest_id> have not |
| 90 been bound as GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB objects. | 117 been bound as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, or |
| 118 GL_TEXTURE_RECTANGLE_ARB objects. | |
| 91 | 119 |
| 92 INVALID_VALUE is generated if textures corresponding to <source_id> have not | 120 INVALID_VALUE is generated if textures corresponding to <source_id> have not |
| 93 been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or | 121 been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or |
| 94 GL_TEXTURE_EXTERNAL_OES objects. | 122 GL_TEXTURE_EXTERNAL_OES objects. |
| 95 | 123 |
| 96 INVALID_VALUE is generated if level 0 of the source texture is not defined. | 124 INVALID_VALUE is generated if <source_level> is not 0 for ES 2.0, or if |
| 125 <source_level> or <dest_level> is less than 0 for ES 3.0. | |
| 126 | |
| 127 INVALID_VALUE is generated if <source_level> of the source texture is not | |
| 128 defined. | |
| 97 | 129 |
| 98 The command | 130 The command |
| 99 | 131 |
| 100 void glCopySubTextureCHROMIUM (GLenum source_id, | 132 void glCopySubTextureCHROMIUM (GLenum source_id, |
| 133 GLint source_level, | |
| 134 GLenum dest_target, | |
| 101 GLenum dest_id, | 135 GLenum dest_id, |
| 136 GLint dest_level, | |
| 102 GLint xoffset, GLint yoffset, | 137 GLint xoffset, GLint yoffset, |
|
Zhenyao Mo
2017/01/19 18:58:31
We should also consider support uploading to a 3D
| |
| 103 GLint x, GLint y, | 138 GLint x, GLint y, |
| 104 GLsizei width, GLsizei height, | 139 GLsizei width, GLsizei height, |
| 105 GLboolean unpack_flip_y, | 140 GLboolean unpack_flip_y, |
| 106 GLboolean unpack_premultiply_alpha, | 141 GLboolean unpack_premultiply_alpha, |
| 107 GLboolean unpack_unmultiply_alpha) | 142 GLboolean unpack_unmultiply_alpha) |
| 108 | 143 |
| 109 Copies the sub contents of texture referred to by <source_id> to <dest_id> | 144 Copies the sub contents of texture referred to by <source_id> to <dest_id> |
| 110 texture without redefining <dest_id> texture. | 145 texture without redefining <dest_id> texture. |
| 111 | 146 |
| 112 See CopyTextureCHROMIUM for the interpretation of the <flip_y>, | 147 See CopyTextureCHROMIUM for the interpretation of the <dest_target>, |
| 113 <premultiply_alpha>, and <unmultiply_alpha> arguments. | 148 <source_level>, <dest_level>, <flip_y>, <premultiply_alpha>, and |
| 149 <unmultiply_alpha> arguments. | |
| 114 | 150 |
| 115 <xoffset> and <yoffset> specify a texel offset in the x and y direction | 151 <xoffset> and <yoffset> specify a texel offset in the x and y direction |
| 116 respectively within the destination texture. | 152 respectively within the destination texture. |
| 117 | 153 |
| 118 <x> and <y> specify specify a texel offset in the x and y direction | 154 <x> and <y> specify specify a texel offset in the x and y direction |
| 119 respectively within the source texture. | 155 respectively within the source texture. |
| 120 | 156 |
| 121 <width> specifies the width of the texture subimage. | 157 <width> specifies the width of the texture subimage. |
| 122 | 158 |
| 123 <height> specifies the width of the texture subimage. | 159 <height> specifies the width of the texture subimage. |
| 124 | 160 |
| 125 INVALID_VALUE is generated if either <source_id> texture or <dest_id> | 161 INVALID_VALUE is generated if either <source_id> texture or <dest_id> |
| 126 texture is not defined. | 162 texture is not defined. |
| 127 | 163 |
| 128 INVALID_OPERATION is generated if source internal_format and destination | 164 INVALID_OPERATION is generated if source internal_format and destination |
| 129 internal_format are not one of the valid formats described above. | 165 internal_format are not one of the valid formats described above. |
| 130 | 166 |
| 131 INVALID_OPERATION is generated if the destination texture has not been | 167 INVALID_OPERATION is generated if the destination texture array has not |
| 132 defined. | 168 been defined. |
| 133 | 169 |
| 134 INVALID_VALUE is generated if <dest_id> texture is not bound as | 170 INVALID_VALUE is generated if <dest_id> texture is not bound as |
| 135 GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. | 171 GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. |
| 136 | 172 |
| 137 INVALID_VALUE is generated if level 0 of the source texture or | 173 INVALID_VALUE is generated if level 0 of the source texture or |
| 138 the destination texture is not defined. | 174 the destination texture is not defined. |
| 139 | 175 |
| 140 INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0. | 176 INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0. |
| 141 | 177 |
| 142 INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width, | 178 INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width, |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 165 None. | 201 None. |
| 166 | 202 |
| 167 Revision History | 203 Revision History |
| 168 | 204 |
| 169 8/1/2011 Documented the extension | 205 8/1/2011 Documented the extension |
| 170 7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM() | 206 7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM() |
| 171 16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target | 207 16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target |
| 172 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and | 208 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and |
| 173 unpack_unmultiply_alpha to both commands. | 209 unpack_unmultiply_alpha to both commands. |
| 174 4/1/2016 Removed the argument target. | 210 4/1/2016 Removed the argument target. |
| 175 4/1/2016 Added GL_TEXTURE_RECTANGLE_ARB as valid dest_id target | 211 4/1/2016 Added GL_TEXTURE_RECTANGLE_ARB as valid dest_id target. |
| 212 19/12/2016 Supported more ES 3.0 formats. | |
| 213 18/1/2017 Supported source_level and dest_level. | |
| 214 19/1/2017 Added GL_TEXTURE_CUBE_MAP as valid dest_id target. | |
| OLD | NEW |