7 GL_CHROMIUM_copy_texture
11 Last Modifed Date: July 16, 2014
15 OpenGL ES 2.0 is required.
17 EXT_texture_format_BGRA8888 affects the definition of this extension.
18 ARB_texture_rg affects the definition of this extension.
22 This extension expands on the functionality provided by the
23 glCopyTexImage2D command. A new function is exported,
24 glCopyTextureCHROMIUM, that performs the same copy operation as
27 The extension also supports copying BGRA textures and copying
28 EXTERNAL_OES texture to BGRA texture, which is not explicitly
29 granted by EXT_texture_format_BGRA8888.
31 New Procedures and Functions
35 void glCopyTextureCHROMIUM (GLenum target, GLenum source_id,
37 GLint internal_format, GLenum dest_type,
38 GLboolean unpack_flip_y,
39 GLboolean unpack_premultiply_alpha,
40 GLboolean unpack_unmultiply_alpha)
42 Copies the contents of texture referred to by <source_id> to <dest_id>
43 texture. If <source_id> texture is not defined or has different dimension
44 to <dest_id> texture, define <source_id> texture same to <dest_id> texture.
46 Texture level 0 is copied from the source image to level 0 of the
49 The internal format of the destination texture is converted to that
50 specified by <internal_format>. Must be one of the following symbolic
51 constants: GL_RGB, GL_RGBA
52 The internal format of <source_id> texture must be one of the following
53 symbolic constants: GL_R8, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
54 GL_RGB, GL_RGBA, GL_BGRA_EXT
55 When <source_id> texture doens't contain a superset of the component
56 required by <internal_format>, fill the components by following rules.
58 source format color components
59 =================================================
62 GL_LUMINANCE (L, L, L, 1)
63 GL_LUMINANCE_ALPHA (L, L, L, A)
66 GL_BGRA_EXT (R, G, B, A)
68 The format type of the destination texture is converted to that specified
71 <target> uses the same parameters as TexImage2D.
73 If <flip_y> is true, vertically flip texture image data.
75 If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true,
76 no alpha processing occurs. This is the equivalent of having neither flag
79 INVALID_OPERATION is generated if <internal_format> is not one of the valid formats
82 INVALID_OPERATION is generated if the internal format of <source_id> is not one of
83 formats from the table above.
85 INVALID_VALUE is generated if <target> is not GL_TEXTURE_2D.
87 INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture
90 INVALID_VALUE is generated if textures corresponding to <dest_id> have not
91 been bound as GL_TEXTURE_2D object.
93 INVALID_VALUE is generated if textures corresponding to <source_id> have not
94 been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or
95 GL_TEXTURE_EXTERNAL_OES objects.
97 INVALID_VALUE is generated if level 0 of the source texture is not defined.
101 void glCopySubTextureCHROMIUM (GLenum target, GLenum source_id,
103 GLint xoffset, GLint yoffset,
105 GLsizei width, GLsizei height,
106 GLboolean unpack_flip_y,
107 GLboolean unpack_premultiply_alpha,
108 GLboolean unpack_unmultiply_alpha)
110 Copies the sub contents of texture referred to by <source_id> to <dest_id>
111 texture without redefining <dest_id> texture.
113 See CopyTextureCHROMIUM for the interpretation of the <target>, <flip_y>,
114 <premultiply_alpha>, and <unmultiply_alpha> arguments.
116 <xoffset> and <yoffset> specify a texel offset in the x and y direction
117 respectively within the destination texture.
119 <x> and <y> specify specify a texel offset in the x and y direction
120 respectively within the source texture.
122 <width> specifies the width of the texture subimage.
124 <height> specifies the width of the texture subimage.
126 INVALID_OPERATION is generated if source internal_format and destination
127 internal_format are not one of the valid formats described above.
129 INVALID_VALUE is generated if <target> is not GL_TEXTURE_2D.
131 INVALID_OPERATION is generated if the destination texture has not been
134 INVALID_VALUE is generated if level 0 of the source texture or
135 the destination texture is not defined.
137 INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0.
139 INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width,
140 or (<yoffset> + <height>) > dest_height.
142 Dependencies on ARB_texture_rg
144 If ARB_texture_rg is not supported:
145 * delete any reference to the R8 format.
161 8/1/2011 Documented the extension
162 7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM()
163 16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target
164 19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and
165 unpack_unmultiply_alpha to both commands.