Renderer::copyImage now uses the ANGLE rectangle structure instead of the windows one.

TRAC #22358 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1747 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 2570c34d
...@@ -498,14 +498,13 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei ...@@ -498,14 +498,13 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
if (width != 0 && height != 0 && level < levelCount()) if (width != 0 && height != 0 && level < levelCount())
{ {
RECT sourceRect; gl::Rectangle sourceRect;
sourceRect.left = x; sourceRect.x = x;
sourceRect.right = x + width; sourceRect.width = width;
sourceRect.top = y; sourceRect.y = y;
sourceRect.bottom = y + height; sourceRect.height = height;
mRenderer->copyImage(source, sourceRect, format, 0, 0, mTexStorage, level); mRenderer->copyImage(source, sourceRect, format, 0, 0, mTexStorage, level);
} }
} }
} }
...@@ -533,11 +532,11 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo ...@@ -533,11 +532,11 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
if (level < levelCount()) if (level < levelCount())
{ {
RECT sourceRect; gl::Rectangle sourceRect;
sourceRect.left = x; sourceRect.x = x;
sourceRect.right = x + width; sourceRect.width = width;
sourceRect.top = y; sourceRect.y = y;
sourceRect.bottom = y + height; sourceRect.height = height;
mRenderer->copyImage(source, sourceRect, mRenderer->copyImage(source, sourceRect,
gl::ExtractFormat(mImageArray[0]->getInternalFormat()), gl::ExtractFormat(mImageArray[0]->getInternalFormat()),
...@@ -1275,14 +1274,13 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint ...@@ -1275,14 +1274,13 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint
if (width > 0 && level < levelCount()) if (width > 0 && level < levelCount())
{ {
RECT sourceRect; gl::Rectangle sourceRect;
sourceRect.left = x; sourceRect.x = x;
sourceRect.right = x + width; sourceRect.width = width;
sourceRect.top = y; sourceRect.y = y;
sourceRect.bottom = y + height; sourceRect.height = height;
mRenderer->copyImage(source, sourceRect, format, 0, 0, mTexStorage, target, level); mRenderer->copyImage(source, sourceRect, format, 0, 0, mTexStorage, target, level);
} }
} }
} }
...@@ -1314,15 +1312,14 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi ...@@ -1314,15 +1312,14 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi
if (level < levelCount()) if (level < levelCount())
{ {
RECT sourceRect; gl::Rectangle sourceRect;
sourceRect.left = x; sourceRect.x = x;
sourceRect.right = x + width; sourceRect.width = width;
sourceRect.top = y; sourceRect.y = y;
sourceRect.bottom = y + height; sourceRect.height = height;
mRenderer->copyImage(source, sourceRect, gl::ExtractFormat(mImageArray[0][0]->getInternalFormat()), mRenderer->copyImage(source, sourceRect, gl::ExtractFormat(mImageArray[0][0]->getInternalFormat()),
xoffset, yoffset, mTexStorage, target, level); xoffset, yoffset, mTexStorage, target, level);
} }
} }
} }
......
...@@ -166,9 +166,9 @@ class Renderer ...@@ -166,9 +166,9 @@ class Renderer
virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source) = 0; virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source) = 0;
virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source) = 0; virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source) = 0;
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level) = 0; GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level) = 0;
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level) = 0; GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level) = 0;
virtual bool blitRect(gl::Framebuffer *readTarget, gl::Rectangle *readRect, gl::Framebuffer *drawTarget, gl::Rectangle *drawRect, virtual bool blitRect(gl::Framebuffer *readTarget, gl::Rectangle *readRect, gl::Framebuffer *drawTarget, gl::Rectangle *drawRect,
......
...@@ -1669,7 +1669,7 @@ bool Renderer11::copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureSt ...@@ -1669,7 +1669,7 @@ bool Renderer11::copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureSt
return false; return false;
} }
bool Renderer11::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, bool Renderer11::copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level) GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level)
{ {
// TODO // TODO
...@@ -1677,7 +1677,7 @@ bool Renderer11::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, ...@@ -1677,7 +1677,7 @@ bool Renderer11::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect,
return false; return false;
} }
bool Renderer11::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, bool Renderer11::copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level) GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level)
{ {
// TODO // TODO
......
...@@ -121,9 +121,9 @@ class Renderer11 : public Renderer ...@@ -121,9 +121,9 @@ class Renderer11 : public Renderer
virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source); virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source);
virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source); virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level); GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level); GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level);
virtual bool blitRect(gl::Framebuffer *readTarget, gl::Rectangle *readRect, gl::Framebuffer *drawTarget, gl::Rectangle *drawRect, virtual bool blitRect(gl::Framebuffer *readTarget, gl::Rectangle *readRect, gl::Framebuffer *drawTarget, gl::Rectangle *drawRect,
......
...@@ -2448,16 +2448,28 @@ D3DPOOL Renderer9::getBufferPool(DWORD usage) const ...@@ -2448,16 +2448,28 @@ D3DPOOL Renderer9::getBufferPool(DWORD usage) const
return D3DPOOL_DEFAULT; return D3DPOOL_DEFAULT;
} }
bool Renderer9::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, bool Renderer9::copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level) GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level)
{ {
return mBlit->copy(framebuffer, sourceRect, destFormat, xoffset, yoffset, storage, level); RECT rect;
rect.left = sourceRect.x;
rect.top = sourceRect.y;
rect.right = sourceRect.x + sourceRect.width;
rect.bottom = sourceRect.y + sourceRect.height;
return mBlit->copy(framebuffer, rect, destFormat, xoffset, yoffset, storage, level);
} }
bool Renderer9::copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, bool Renderer9::copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level) GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level)
{ {
return mBlit->copy(framebuffer, sourceRect, destFormat, xoffset, yoffset, storage, target, level); RECT rect;
rect.left = sourceRect.x;
rect.top = sourceRect.y;
rect.right = sourceRect.x + sourceRect.width;
rect.bottom = sourceRect.y + sourceRect.height;
return mBlit->copy(framebuffer, rect, destFormat, xoffset, yoffset, storage, target, level);
} }
bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, gl::Rectangle *readRect, gl::Framebuffer *drawFramebuffer, gl::Rectangle *drawRect, bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, gl::Rectangle *readRect, gl::Framebuffer *drawFramebuffer, gl::Rectangle *drawRect,
......
...@@ -150,9 +150,9 @@ class Renderer9 : public Renderer ...@@ -150,9 +150,9 @@ class Renderer9 : public Renderer
virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source); virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source);
virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source); virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level); GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level);
virtual bool copyImage(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level); GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level);
virtual bool blitRect(gl::Framebuffer *readTarget, gl::Rectangle *readRect, gl::Framebuffer *drawTarget, gl::Rectangle *drawRect, virtual bool blitRect(gl::Framebuffer *readTarget, gl::Rectangle *readRect, gl::Framebuffer *drawTarget, gl::Rectangle *drawRect,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment