[ooo-build-commit] Branch 'ooo/OOO320' - canvas/source vcl/source
Jan Holesovsky
kendy at kemper.freedesktop.org
Wed Oct 14 18:53:13 PDT 2009
canvas/source/directx/dx_9rm.cxx | 44 +++++++++++++++++++++++----
canvas/source/directx/dx_surfacegraphics.cxx | 5 ++-
vcl/source/gdi/region.cxx | 13 ++++---
3 files changed, 50 insertions(+), 12 deletions(-)
New commits:
commit ada2118e6e0fc2467ccbec6349a712adfd507f5b
Author: Oliver Bolte <obo at openoffice.org>
Date: Wed Oct 14 09:28:38 2009 +0000
CWS-TOOLING: integrate CWS impress177_OOO320
2009-10-07 13:02:12 +0200 sj r276751 : #i104579# fixed horz and vert adjustment for master styles (excluding notes master)
2009-10-06 18:09:14 +0200 sj r276724 : #i104579# fixed horz and vert adjustment for master styles
2009-10-05 15:02:38 +0200 sj r276679 : #i104685# fixed text color problem
2009-10-02 14:01:22 +0200 aw r276641 : #i105508# added own flag for ClipOnBounds to SdrBlockTextPrimitive2D and the helper createTextPrimitive; adapted usages; corrected VerticalText stuff; corrected ClipOnBounds for CustomShapes
2009-09-30 11:55:44 +0200 cl r276550 : CWS-TOOLING: rebase CWS impress177 to trunk at 276429 (milestone: DEV300:m60)
2009-09-28 17:57:37 +0200 cl r276498 : #i94900# after a paste special make sure the stylesheets for outline shapes are correct
2009-09-24 17:36:29 +0200 af r276425 : #i103464# Restore device more reliably.
2009-09-24 12:29:31 +0200 sj r276417 : #i104685# fixed text color propblem
2009-09-22 16:48:06 +0200 sj r276360 : #i104682# fixed table border line thickness
2009-09-22 16:46:29 +0200 sj r276359 : #i104682# fixed table border line thickness
2009-09-22 10:29:30 +0200 sj r276346 : #104579# fixed horz and vert adjustment for master styles
2009-09-21 14:18:29 +0200 af r276330 : #i100905# Fixed crash when region is split into bands.
2009-09-15 15:44:30 +0200 cl r276181 : #i103179# always hide presentation shapes from master page if rendered as slide background
2009-09-15 10:44:52 +0200 cl r276155 : #i104579# return correct IsEmptyPresObj state
2009-09-14 16:51:41 +0200 cl r276132 : #i96538# restored OOo 3.0 numbering behaviour
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx
index a9b425b..c6705e9 100755
--- a/canvas/source/directx/dx_9rm.cxx
+++ b/canvas/source/directx/dx_9rm.cxx
@@ -228,7 +228,7 @@ namespace dxcanvas
bool createDevice();
bool verifyDevice( const UINT nAdapter );
UINT getAdapterFromWindow();
-
+
/** This object represents the DirectX state machine. In order
to serialize access to DirectX's global state, a global
mutex is required.
@@ -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 7796e1e..1ba6dcb 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();
}
}
diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx
index 87a0801..0e9280e 100644
--- a/vcl/source/gdi/region.cxx
+++ b/vcl/source/gdi/region.cxx
@@ -153,7 +153,8 @@ void ImplAddMissingBands (
// We still have to cover two cases:
// 1. The region does not yet contain any bands.
// 2. The intervall nTop->nBottom extends past the bottom most band.
- if (nCurrentTop < nBottom && (pBand==NULL || nBottom>pBand->mnYBottom))
+ if (nCurrentTop <= nBottom
+ && (pBand==NULL || nBottom>pBand->mnYBottom))
{
// When there is no previous band then the new one will be the
// first. Otherwise the new band is inserted behind the last band.
@@ -232,8 +233,9 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
ImplRegionBand* pTopBand = pBand;
// If necessary split the band at nTop so that nTop is contained
// in the lower band.
- if ( // Prevent the current band from becoming 0 pixel high
- pBand->mnYTop<nTop
+ if (pBand!=NULL
+ // Prevent the current band from becoming 0 pixel high
+ && pBand->mnYTop<nTop
// this allows the lowest pixel of the band to be split off
&& pBand->mnYBottom>=nTop
// do not split a band that is just one pixel high
@@ -248,8 +250,9 @@ ImplRegion* ImplRectilinearPolygonToBands (const PolyPolygon& rPolyPoly)
pBand = pBand->mpNextBand;
// The lowest band may have to be split at nBottom so that
// nBottom itself remains in the upper band.
- if ( // allow the current band becoming 1 pixel high
- pBand->mnYTop<=nBottom
+ if (pBand!=NULL
+ // allow the current band becoming 1 pixel high
+ && pBand->mnYTop<=nBottom
// prevent splitting off a band that is 0 pixel high
&& pBand->mnYBottom>nBottom
// do not split a band that is just one pixel high
More information about the ooo-build-commit
mailing list