Hash :
97073d12
Author :
Date :
2016-04-20T10:42:34
Implement CHROMIUM_copy_texture for D3D11. BUG=angleproject:1356 Change-Id: I70246762411dbeeb3e291e317854139a68d80070 Reviewed-on: https://chromium-review.googlesource.com/339434 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
Name
CHROMIUM_copy_texture
Name Strings
GL_CHROMIUM_copy_texture
Version
Last Modifed Date: July 16, 2014
Dependencies
OpenGL ES 2.0 is required.
EXT_texture_format_BGRA8888 affects the definition of this extension.
ARB_texture_rg affects the definition of this extension.
CHROMIUM_ycbcr_422_image affects the definition of this extension.
Overview
This extension expands on the functionality provided by the
glCopyTexImage2D command. A new function is exported,
glCopyTextureCHROMIUM, that performs the same copy operation as
glCopyTexImage2D.
The extension also supports copying BGRA textures and copying
EXTERNAL_OES texture to BGRA texture, which is not explicitly
granted by EXT_texture_format_BGRA8888.
New Procedures and Functions
The command
void glCopyTextureCHROMIUM (GLuint source_id,
GLuint dest_id,
GLint internal_format, GLenum dest_type,
GLboolean unpack_flip_y,
GLboolean unpack_premultiply_alpha,
GLboolean unpack_unmultiply_alpha)
Copies the contents of <source_id> texture to <dest_id> texture.
Texture level 0 is copied from the source image to level 0 of the
destination texture.
The internal format of the destination texture is converted to that
specified by <internal_format>. Must be one of the following symbolic
constants: GL_RGB, GL_RGBA
The internal format of <source_id> texture must be one of the following
symbolic constants: GL_R8, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
GL_RGB, GL_RGBA, GL_BGRA_EXT, GL_RGB_YCBCR_422_CHROMIUM
When <source_id> texture doens't contain a superset of the component
required by <internal_format>, fill the components by following rules.
source format color components
=====================================================
GL_ALPHA (0, 0, 0, A)
GL_R8 (R, 0, 0, 1)
GL_LUMINANCE (L, L, L, 1)
GL_LUMINANCE_ALPHA (L, L, L, A)
GL_RGB (R, G, B, 1)
GL_RGBA (R, G, B, A)
GL_BGRA_EXT (R, G, B, A)
GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1)
The format type of the destination texture is converted to that specified
by <dest_type>.
If <flip_y> is true, vertically flip texture image data.
If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true,
no alpha processing occurs. This is the equivalent of having neither flag
set.
When <source_id> refers to a stream texture, the texture matrix will be
applied as part of the copy operation.
INVALID_OPERATION is generated if <internal_format> is not one of the valid formats
described above.
INVALID_OPERATION is generated if the internal format of <source_id> is not one of
formats from the table above.
INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture
objects.
INVALID_VALUE is generated if textures corresponding to <dest_id> have not
been bound as GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB objects.
INVALID_VALUE is generated if textures corresponding to <source_id> have not
been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or
GL_TEXTURE_EXTERNAL_OES objects.
INVALID_VALUE is generated if level 0 of the source texture is not defined.
The command
void glCopySubTextureCHROMIUM (GLuint source_id,
GLuint dest_id,
GLint xoffset, GLint yoffset,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLboolean unpack_flip_y,
GLboolean unpack_premultiply_alpha,
GLboolean unpack_unmultiply_alpha)
Copies the sub contents of texture referred to by <source_id> to <dest_id>
texture without redefining <dest_id> texture.
See CopyTextureCHROMIUM for the interpretation of the <flip_y>,
<premultiply_alpha>, and <unmultiply_alpha> arguments.
<xoffset> and <yoffset> specify a texel offset in the x and y direction
respectively within the destination texture.
<x> and <y> specify specify a texel offset in the x and y direction
respectively within the source texture.
<width> specifies the width of the texture subimage.
<height> specifies the width of the texture subimage.
INVALID_VALUE is generated if either <source_id> texture or <dest_id>
texture is not defined.
INVALID_OPERATION is generated if source internal_format and destination
internal_format are not one of the valid formats described above.
INVALID_OPERATION is generated if the destination texture has not been
defined.
INVALID_VALUE is generated if <dest_id> texture is not bound as
GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB.
INVALID_VALUE is generated if level 0 of the source texture or
the destination texture is not defined.
INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0.
INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width,
or (<yoffset> + <height>) > dest_height.
Dependencies on ARB_texture_rg
If ARB_texture_rg is not supported:
* delete any reference to the R8 format.
Dependencies on CHROMIUM_ycbcr_422_image
If CHROMIUM_ycbcr_422_image is not supported:
* delete any reference to the RGB_YCBCR_422_CHROMIUM format.
Errors
None.
New Tokens
None.
New State
None.
Revision History
8/1/2011 Documented the extension
7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM()
16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target
19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and
unpack_unmultiply_alpha to both commands.
4/1/2016 Removed the argument target.
4/1/2016 Added GL_TEXTURE_RECTANGLE_ARB as valid dest_id target