TextureColorbufferProxy must query the texture to get the latest width & height.

TRAC #12372

Signed-off-by: Daniel Koch

Author:    Andrew Lewycky

git-svn-id: https://angleproject.googlecode.com/svn/trunk@315 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Renderbuffer.cpp b/src/libGLESv2/Renderbuffer.cpp
index 32eabcf..edd38ec 100644
--- a/src/libGLESv2/Renderbuffer.cpp
+++ b/src/libGLESv2/Renderbuffer.cpp
@@ -64,6 +64,13 @@
     return mHeight;
 }
 
+void Renderbuffer::setSize(int width, int height)
+{
+    mWidth = width;
+    mHeight = height;
+}
+
+
 GLenum Renderbuffer::getFormat()
 {
     return mFormat;
@@ -88,8 +95,7 @@
         D3DSURFACE_DESC description;
         renderTarget->GetDesc(&description);
 
-        mWidth = description.Width;
-        mHeight = description.Height;
+        setSize(description.Width, description.Height);
     }
 
 }
@@ -113,14 +119,12 @@
 
     if (mRenderTarget)
     {
-        mWidth = width;
-        mHeight = height;
+        setSize(width, height);
         mFormat = format;
     }
     else
     {
-        mWidth = 0;
-        mHeight = 0;
+        setSize(0, 0);
         mFormat = GL_RGBA4;
     }
 }
@@ -204,8 +208,7 @@
         D3DSURFACE_DESC description;
         depthStencil->GetDesc(&description);
 
-        mWidth = description.Width;
-        mHeight = description.Height;
+        setSize(description.Width, description.Height);
         mFormat = GL_DEPTH_COMPONENT16; // If the renderbuffer parameters are queried, the calling function
                                         // will expect one of the valid renderbuffer formats for use in 
                                         // glRenderbufferStorage
@@ -230,16 +233,14 @@
 
     if (mDepthStencil)
     {
-        mWidth = width;
-        mHeight = height;
+        setSize(width, height);
         mFormat = GL_DEPTH_COMPONENT16; // If the renderbuffer parameters are queried, the calling function
                                         // will expect one of the valid renderbuffer formats for use in 
                                         // glRenderbufferStorage
     }
     else
     {
-        mWidth = 0;
-        mHeight = 0;
+        setSize(0, 0);
         mFormat = GL_RGBA4; //default format
     }
 }
@@ -284,8 +285,7 @@
         D3DSURFACE_DESC description;
         depthStencil->GetDesc(&description);
 
-        mWidth = description.Width;
-        mHeight = description.Height;
+        setSize(description.Width, description.Height);
         mFormat = GL_STENCIL_INDEX8; // If the renderbuffer parameters are queried, the calling function
                                      // will expect one of the valid renderbuffer formats for use in 
                                      // glRenderbufferStorage
@@ -310,16 +310,14 @@
 
     if (mDepthStencil)
     {
-        mWidth = width;
-        mHeight = height;
+        setSize(width, height);
         mFormat = GL_STENCIL_INDEX8; // If the renderbuffer parameters are queried, the calling function
                                      // will expect one of the valid renderbuffer formats for use in 
                                      // glRenderbufferStorage
     }
     else
     {
-        mWidth = 0;
-        mHeight = 0;
+        setSize(0, 0);
         mFormat = GL_RGBA4; //default format
     }
 }