Bug 649233 - Include ANGLE r551. r=joe
authorBenoit Jacob <bjacob@mozilla.com>
Tue, 12 Apr 2011 00:36:13 -0700
changeset 63417 e217fcf59016a79ee0c40f9f22a83d7873e7efda
parent 63416 98a7a9f64302bbc4930cf8946308421ce5a86f21
child 63418 1ae9e61776a894acc28309914d92c26f2880a714
push id62
push userjdrew@mozilla.com
push dateTue, 12 Apr 2011 09:01:14 +0000
reviewersjoe
bugs649233
milestone2.0.1pre
Bug 649233 - Include ANGLE r551. r=joe
gfx/angle/src/libGLESv2/Texture.cpp
--- a/gfx/angle/src/libGLESv2/Texture.cpp
+++ b/gfx/angle/src/libGLESv2/Texture.cpp
@@ -1313,19 +1313,16 @@ bool Texture2D::redefineTexture(GLint le
             mTexture = NULL;
             dropTexture();
         }
 
         mWidth = width << level;
         mHeight = height << level;
         mImageArray[0].format = internalFormat;
         mType = type;
-
-        if (mColorbufferProxy.get())
-            mColorbufferProxy->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_2D));
     }
 
     return !textureOkay;
 }
 
 void Texture2D::setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
 {
     redefineTexture(level, internalFormat, width, height, type);
@@ -1350,25 +1347,21 @@ void Texture2D::commitRect(GLint level, 
         HRESULT result = mTexture->GetSurfaceLevel(level, &destLevel);
 
         ASSERT(SUCCEEDED(result));
 
         if (SUCCEEDED(result))
         {
             Image *img = &mImageArray[level];
 
-            RECT sourceRect;
-            sourceRect.left = xoffset;
-            sourceRect.top = yoffset;
-            sourceRect.right = xoffset + width;
-            sourceRect.bottom = yoffset + height;
+            RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, img->height);;
 
             POINT destPoint;
-            destPoint.x = xoffset;
-            destPoint.y = yoffset;
+            destPoint.x = sourceRect.left;
+            destPoint.y = sourceRect.top;
 
             result = getDevice()->UpdateSurface(img->surface, &sourceRect, destLevel, &destPoint);
             ASSERT(SUCCEEDED(result));
 
             destLevel->Release();
 
             img->dirty = false;
         }
@@ -1888,25 +1881,21 @@ void TextureCubeMap::commitRect(GLenum f
     {
         IDirect3DSurface9 *destLevel = getCubeMapSurface(faceTarget, level);
         ASSERT(destLevel != NULL);
 
         if (destLevel != NULL)
         {
             Image *img = &mImageArray[face][level];
 
-            RECT sourceRect;
-            sourceRect.left = xoffset;
-            sourceRect.top = yoffset;
-            sourceRect.right = xoffset + width;
-            sourceRect.bottom = yoffset + height;
+            RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, img->height);;
 
             POINT destPoint;
-            destPoint.x = xoffset;
-            destPoint.y = yoffset;
+            destPoint.x = sourceRect.left;
+            destPoint.y = sourceRect.top;
 
             HRESULT result = getDevice()->UpdateSurface(img->surface, &sourceRect, destLevel, &destPoint);
             ASSERT(SUCCEEDED(result));
 
             destLevel->Release();
 
             img->dirty = false;
         }
@@ -2213,22 +2202,16 @@ bool TextureCubeMap::redefineTexture(GLi
         }
 
         mWidth = width << level;
         mImageArray[0][0].width = width << level;
         mHeight = width << level;
         mImageArray[0][0].height = width << level;
 
         mImageArray[0][0].format = internalFormat;
-
-        for (int i = 0; i < 6; i++)
-        {
-            if (mFaceProxies[i].get())
-                mFaceProxies[i]->setStorage(new TextureColorbufferProxy(this, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i));
-        }
     }
 
     return !textureOkay;
 }
 
 void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
 {
     IDirect3DSurface9 *renderTarget = source->getRenderTarget();