Commit 9f300b0f by apatrick@chromium.org

Fixed commitRect so it correctly flips the source rectangle and dest point on Y.

Review URL: http://codereview.appspot.com/4047050 git-svn-id: https://angleproject.googlecode.com/svn/trunk@551 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 55d0be04
...@@ -1352,15 +1352,11 @@ void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei wi ...@@ -1352,15 +1352,11 @@ void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei wi
{ {
Image *img = &mImageArray[level]; Image *img = &mImageArray[level];
RECT sourceRect; RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, img->height);;
sourceRect.left = xoffset;
sourceRect.top = yoffset;
sourceRect.right = xoffset + width;
sourceRect.bottom = yoffset + height;
POINT destPoint; POINT destPoint;
destPoint.x = xoffset; destPoint.x = sourceRect.left;
destPoint.y = yoffset; destPoint.y = sourceRect.top;
result = getDevice()->UpdateSurface(img->surface, &sourceRect, destLevel, &destPoint); result = getDevice()->UpdateSurface(img->surface, &sourceRect, destLevel, &destPoint);
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
...@@ -1890,15 +1886,11 @@ void TextureCubeMap::commitRect(GLenum faceTarget, GLint level, GLint xoffset, G ...@@ -1890,15 +1886,11 @@ void TextureCubeMap::commitRect(GLenum faceTarget, GLint level, GLint xoffset, G
{ {
Image *img = &mImageArray[face][level]; Image *img = &mImageArray[face][level];
RECT sourceRect; RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, img->height);;
sourceRect.left = xoffset;
sourceRect.top = yoffset;
sourceRect.right = xoffset + width;
sourceRect.bottom = yoffset + height;
POINT destPoint; POINT destPoint;
destPoint.x = xoffset; destPoint.x = sourceRect.left;
destPoint.y = yoffset; destPoint.y = sourceRect.top;
HRESULT result = getDevice()->UpdateSurface(img->surface, &sourceRect, destLevel, &destPoint); HRESULT result = getDevice()->UpdateSurface(img->surface, &sourceRect, destLevel, &destPoint);
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
......
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