Only replace image surfaces with equal-sized managed surfaces.

TRAC #21621 Issue=311 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1314 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 853b577f
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 1307 #define BUILD_REVISION 1314
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -298,19 +298,21 @@ IDirect3DSurface9 *Image::getSurface() ...@@ -298,19 +298,21 @@ IDirect3DSurface9 *Image::getSurface()
void Image::setManagedSurface(IDirect3DSurface9 *surface) void Image::setManagedSurface(IDirect3DSurface9 *surface)
{ {
if (mSurface)
{
CopyLockableSurfaces(surface, mSurface);
mSurface->Release();
}
D3DSURFACE_DESC desc; D3DSURFACE_DESC desc;
surface->GetDesc(&desc); surface->GetDesc(&desc);
ASSERT(desc.Pool == D3DPOOL_MANAGED); ASSERT(desc.Pool == D3DPOOL_MANAGED);
mSurface = surface; if ((GLsizei)desc.Width == mWidth && (GLsizei)desc.Height == mHeight)
mD3DPool = desc.Pool; {
if (mSurface)
{
CopyLockableSurfaces(surface, mSurface);
mSurface->Release();
}
mSurface = surface;
mD3DPool = desc.Pool;
}
} }
void Image::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height) void Image::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
......
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