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>
diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp
index 0e9c078..e0c45b5 100644
--- a/src/libANGLE/Context.cpp
+++ b/src/libANGLE/Context.cpp
@@ -2730,6 +2730,52 @@
handleError(texture->generateMipmap());
}
+void Context::copyTextureCHROMIUM(GLuint sourceId,
+ GLuint destId,
+ GLint internalFormat,
+ GLenum destType,
+ GLboolean unpackFlipY,
+ GLboolean unpackPremultiplyAlpha,
+ GLboolean unpackUnmultiplyAlpha)
+{
+ syncStateForTexImage();
+
+ gl::Texture *sourceTexture = getTexture(sourceId);
+ gl::Texture *destTexture = getTexture(destId);
+ handleError(destTexture->copyTexture(internalFormat, destType, unpackFlipY == GL_TRUE,
+ unpackPremultiplyAlpha == GL_TRUE,
+ unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
+}
+
+void Context::copySubTextureCHROMIUM(GLuint sourceId,
+ GLuint destId,
+ GLint xoffset,
+ GLint yoffset,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height,
+ GLboolean unpackFlipY,
+ GLboolean unpackPremultiplyAlpha,
+ GLboolean unpackUnmultiplyAlpha)
+{
+ // Zero sized copies are valid but no-ops
+ if (width == 0 || height == 0)
+ {
+ return;
+ }
+
+ syncStateForTexImage();
+
+ gl::Texture *sourceTexture = getTexture(sourceId);
+ gl::Texture *destTexture = getTexture(destId);
+ Offset offset(xoffset, yoffset, 0);
+ Rectangle area(x, y, width, height);
+ handleError(destTexture->copySubTexture(offset, area, unpackFlipY == GL_TRUE,
+ unpackPremultiplyAlpha == GL_TRUE,
+ unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
+}
+
void Context::getBufferPointerv(GLenum target, GLenum /*pname*/, void **params)
{
Buffer *buffer = mGLState.getTargetBuffer(target);