2 diff -u -p -r1.5 dx_9rm.cxx
3 --- canvas/source/directx/dx_9rm.cxx 24 Jun 2008 10:30:05 -0000 1.5
4 +++ canvas/source/directx/dx_9rm.cxx 10 Dec 2008 14:51:17 -0000
6 #include <canvas/debug.hxx>
7 #include <canvas/verbosetrace.hxx>
8 #include <tools/diagnose_ex.h>
9 +#include <osl/thread.h>
11 #include <canvas/elapsedtime.hxx>
12 #include <canvas/canvastools.hxx>
13 @@ -956,11 +957,43 @@ namespace dxcanvas
15 if(hr != D3DERR_DEVICELOST)
17 - hr = mpDevice->Reset(&mad3dpp);
20 - if(hr == D3DERR_DEVICELOST)
23 + // interestingly enough, sometimes the Reset() below
24 + // *still* causes DeviceLost errors. So, cycle until
25 + // DX was kind enough to really reset the device...
28 + mpVertexBuffer.reset();
29 + hr = mpDevice->Reset(&mad3dpp);
32 + IDirect3DVertexBuffer9 *pVB(NULL);
33 + DWORD aFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1);
34 + if( FAILED(mpDevice->CreateVertexBuffer(sizeof(dxvertex)*maNumVertices,
35 + D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY,
41 + throw lang::NoSupportException(
42 + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
43 + "Could not create DirectX device - out of memory!")),NULL);
45 + mpVertexBuffer=COMReference<IDirect3DVertexBuffer9>(pVB);
47 + // retry after the restore
48 + if(SUCCEEDED(mpSwapChain->Present(&aRect,&aRect,NULL,NULL,0)))
55 + osl_waitThread(&aTimeout);
57 + while(hr == D3DERR_DEVICELOST);
62 diff -u -p -r1.4 dx_surfacegraphics.cxx
63 --- canvas/source/directx/dx_surfacegraphics.cxx 24 Jun 2008 10:39:29 -0000 1.4
64 +++ canvas/source/directx/dx_surfacegraphics.cxx 10 Dec 2008 14:51:25 -0000
66 #include "dx_surfacegraphics.hxx"
67 #include "dx_impltools.hxx"
69 +using namespace ::com::sun::star;
74 @@ -75,11 +77,12 @@ namespace dxcanvas
75 tools::setupGraphics( *pGraphics );
77 GraphicsDeleter(rSurface, aHDC));
81 rSurface->ReleaseDC( aHDC );
85 + throw uno::RuntimeException();