diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-10-26 17:41:29 +0100 |
commit | 37cd2a528c5346a56e5d65e2991443e78f56489a (patch) | |
tree | 7d1338fa631c51f5fb71486f7e35c51c6786ce88 /canvas/source | |
parent | acae9170ea69e3b54b31ebf0322b53e4818172a3 (diff) | |
parent | cf144cb77169bfc84604434f4b7923fe5dac3d1e (diff) |
merge commit for m62
Diffstat (limited to 'canvas/source')
-rw-r--r-- | canvas/source/cairo/cairo_textlayout.cxx | 6 | ||||
-rwxr-xr-x | canvas/source/directx/dx_9rm.cxx | 42 | ||||
-rwxr-xr-x | canvas/source/directx/dx_surfacegraphics.cxx | 5 |
3 files changed, 47 insertions, 6 deletions
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index f822749cab20..08a4e7a70fa1 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -44,6 +44,12 @@ #include <tools/prewin.h> #include <windows.h> #include <tools/postwin.h> +#ifdef max +#undef max +#endif +#ifdef min +#undef min +#endif #endif #include <vcl/sysdata.hxx> diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index 932a15e1f5c1..acef323ddc1b 100755 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -956,11 +956,43 @@ namespace dxcanvas { if(hr != D3DERR_DEVICELOST) return false; - hr = mpDevice->Reset(&mad3dpp); - if(SUCCEEDED(hr)) - return true; - if(hr == D3DERR_DEVICELOST) - return true; + + // interestingly enough, sometimes the Reset() below + // *still* causes DeviceLost errors. So, cycle until + // DX was kind enough to really reset the device... + do + { + mpVertexBuffer.reset(); + hr = mpDevice->Reset(&mad3dpp); + if(SUCCEEDED(hr)) + { + IDirect3DVertexBuffer9 *pVB(NULL); + DWORD aFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1); + if( FAILED(mpDevice->CreateVertexBuffer(sizeof(dxvertex)*maNumVertices, + D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, + aFVF, + D3DPOOL_DEFAULT, + &pVB, + NULL)) ) + { + throw lang::NoSupportException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "Could not create DirectX device - out of memory!")),NULL); + } + mpVertexBuffer=COMReference<IDirect3DVertexBuffer9>(pVB); + + // retry after the restore + if(SUCCEEDED(mpSwapChain->Present(&aRect,&aRect,NULL,NULL,0))) + return true; + } + + TimeValue aTimeout; + aTimeout.Seconds=1; + aTimeout.Nanosec=0; + osl_waitThread(&aTimeout); + } + while(hr == D3DERR_DEVICELOST); + return false; } diff --git a/canvas/source/directx/dx_surfacegraphics.cxx b/canvas/source/directx/dx_surfacegraphics.cxx index 128095c1315d..8b9af6be6827 100755 --- a/canvas/source/directx/dx_surfacegraphics.cxx +++ b/canvas/source/directx/dx_surfacegraphics.cxx @@ -34,6 +34,8 @@ #include "dx_surfacegraphics.hxx" #include "dx_impltools.hxx" +using namespace ::com::sun::star; + namespace dxcanvas { namespace @@ -75,11 +77,12 @@ namespace dxcanvas tools::setupGraphics( *pGraphics ); pRet.reset(pGraphics, GraphicsDeleter(rSurface, aHDC)); + return pRet; } else rSurface->ReleaseDC( aHDC ); } - return pRet; + throw uno::RuntimeException(); } } |