Kaydet (Commit) dcb89025 authored tarafından Fridrich Štrba's avatar Fridrich Štrba

Revert "Work around compilation errors on 64-bit Windows"

This reverts commit a82aae8c5da6d708ff0efd17d28548f6d2fa5cc0, which breaks
directx canvas build on Windows 32-bit
üst bdfe8dfb
...@@ -342,9 +342,9 @@ namespace dxcanvas ...@@ -342,9 +342,9 @@ namespace dxcanvas
boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(fT); boost::tuples::tie(nIndex,fAlpha)=aLerper.lerp(fT);
const Gdiplus::Color aFillColor( const Gdiplus::Color aFillColor(
static_cast<WIN_BYTE>( basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha) ), static_cast<BYTE>( basegfx::tools::lerp(rColors[nIndex].GetRed(),rColors[nIndex+1].GetRed(),fAlpha) ),
static_cast<WIN_BYTE>( basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha) ), static_cast<BYTE>( basegfx::tools::lerp(rColors[nIndex].GetGreen(),rColors[nIndex+1].GetGreen(),fAlpha) ),
static_cast<WIN_BYTE>( basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha) ) ); static_cast<BYTE>( basegfx::tools::lerp(rColors[nIndex].GetBlue(),rColors[nIndex+1].GetBlue(),fAlpha) ) );
aFillBrush.SetColor( aFillColor ); aFillBrush.SetColor( aFillColor );
aCurrPath.Reset(); aCurrPath.StartFigure(); aCurrPath.Reset(); aCurrPath.StartFigure();
......
...@@ -370,7 +370,7 @@ namespace dxcanvas ...@@ -370,7 +370,7 @@ namespace dxcanvas
pResult.reset(new Gdiplus::Bitmap( maSize.getX(),maSize.getY(), pResult.reset(new Gdiplus::Bitmap( maSize.getX(),maSize.getY(),
aSurfaceDesc.lPitch, aSurfaceDesc.lPitch,
nFormat, nFormat,
(WIN_BYTE *)aSurfaceDesc.lpSurface )); (BYTE *)aSurfaceDesc.lpSurface ));
// unlock the directx surface // unlock the directx surface
mpSurface->Unlock(NULL); mpSurface->Unlock(NULL);
...@@ -387,7 +387,7 @@ namespace dxcanvas ...@@ -387,7 +387,7 @@ namespace dxcanvas
pResult.reset(new Gdiplus::Bitmap( maSize.getX(),maSize.getY(), pResult.reset(new Gdiplus::Bitmap( maSize.getX(),maSize.getY(),
aLockedRect.Pitch, aLockedRect.Pitch,
nFormat, nFormat,
(WIN_BYTE *)aLockedRect.pBits )); (BYTE *)aLockedRect.pBits ));
mpSurface->UnlockRect(); mpSurface->UnlockRect();
} }
...@@ -560,7 +560,7 @@ namespace dxcanvas ...@@ -560,7 +560,7 @@ namespace dxcanvas
if(FAILED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL))) if(FAILED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL)))
return uno::Sequence< sal_Int8 >(); return uno::Sequence< sal_Int8 >();
sal_uInt8 *pSrc = (sal_uInt8 *)((((WIN_BYTE *)aSurfaceDesc.lpSurface)+(rect.Y1*aSurfaceDesc.lPitch))+rect.X1); sal_uInt8 *pSrc = (sal_uInt8 *)((((BYTE *)aSurfaceDesc.lpSurface)+(rect.Y1*aSurfaceDesc.lPitch))+rect.X1);
sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray(); sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray();
sal_uInt32 nSegmentSizeInBytes = nWidth<<4; sal_uInt32 nSegmentSizeInBytes = nWidth<<4;
for(sal_uInt32 y=0; y<nHeight; ++y) for(sal_uInt32 y=0; y<nHeight; ++y)
...@@ -576,7 +576,7 @@ namespace dxcanvas ...@@ -576,7 +576,7 @@ namespace dxcanvas
if(FAILED(mpSurface->LockRect(&aLockedRect,NULL,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY))) if(FAILED(mpSurface->LockRect(&aLockedRect,NULL,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)))
return uno::Sequence< sal_Int8 >(); return uno::Sequence< sal_Int8 >();
sal_uInt8 *pSrc = (sal_uInt8 *)((((WIN_BYTE *)aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1); sal_uInt8 *pSrc = (sal_uInt8 *)((((BYTE *)aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1);
sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray(); sal_uInt8 *pDst = (sal_uInt8 *)aRes.getArray();
sal_uInt32 nSegmentSizeInBytes = nWidth<<4; sal_uInt32 nSegmentSizeInBytes = nWidth<<4;
for(sal_uInt32 y=0; y<nHeight; ++y) for(sal_uInt32 y=0; y<nHeight; ++y)
...@@ -643,7 +643,7 @@ namespace dxcanvas ...@@ -643,7 +643,7 @@ namespace dxcanvas
throw uno::RuntimeException(); throw uno::RuntimeException();
sal_uInt8 *pSrc = (sal_uInt8 *)data.getConstArray(); sal_uInt8 *pSrc = (sal_uInt8 *)data.getConstArray();
sal_uInt8 *pDst = (sal_uInt8 *)((((WIN_BYTE *)aSurfaceDesc.lpSurface)+(rect.Y1*aSurfaceDesc.lPitch))+rect.X1); sal_uInt8 *pDst = (sal_uInt8 *)((((BYTE *)aSurfaceDesc.lpSurface)+(rect.Y1*aSurfaceDesc.lPitch))+rect.X1);
sal_uInt32 nSegmentSizeInBytes = nWidth<<4; sal_uInt32 nSegmentSizeInBytes = nWidth<<4;
for(sal_uInt32 y=0; y<nHeight; ++y) for(sal_uInt32 y=0; y<nHeight; ++y)
{ {
...@@ -660,7 +660,7 @@ namespace dxcanvas ...@@ -660,7 +660,7 @@ namespace dxcanvas
throw uno::RuntimeException(); throw uno::RuntimeException();
sal_uInt8 *pSrc = (sal_uInt8 *)data.getConstArray(); sal_uInt8 *pSrc = (sal_uInt8 *)data.getConstArray();
sal_uInt8 *pDst = (sal_uInt8 *)((((WIN_BYTE *)aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1); sal_uInt8 *pDst = (sal_uInt8 *)((((BYTE *)aLockedRect.pBits)+(rect.Y1*aLockedRect.Pitch))+rect.X1);
sal_uInt32 nSegmentSizeInBytes = nWidth<<4; sal_uInt32 nSegmentSizeInBytes = nWidth<<4;
for(sal_uInt32 y=0; y<nHeight; ++y) for(sal_uInt32 y=0; y<nHeight; ++y)
{ {
...@@ -722,7 +722,7 @@ namespace dxcanvas ...@@ -722,7 +722,7 @@ namespace dxcanvas
if(FAILED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL))) if(FAILED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL)))
throw uno::RuntimeException(); throw uno::RuntimeException();
sal_uInt32 *pDst = (sal_uInt32 *)((((WIN_BYTE *)aSurfaceDesc.lpSurface)+(pos.Y*aSurfaceDesc.lPitch))+pos.X); sal_uInt32 *pDst = (sal_uInt32 *)((((BYTE *)aSurfaceDesc.lpSurface)+(pos.Y*aSurfaceDesc.lPitch))+pos.X);
*pDst = aColor.GetValue(); *pDst = aColor.GetValue();
mpSurface->Unlock(NULL); mpSurface->Unlock(NULL);
#else #else
...@@ -731,7 +731,7 @@ namespace dxcanvas ...@@ -731,7 +731,7 @@ namespace dxcanvas
if(FAILED(mpSurface->LockRect(&aLockedRect,NULL,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY))) if(FAILED(mpSurface->LockRect(&aLockedRect,NULL,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)))
throw uno::RuntimeException(); throw uno::RuntimeException();
sal_uInt32 *pDst = (sal_uInt32 *)((((WIN_BYTE *)aLockedRect.pBits)+(pos.Y*aLockedRect.Pitch))+pos.X); sal_uInt32 *pDst = (sal_uInt32 *)((((BYTE *)aLockedRect.pBits)+(pos.Y*aLockedRect.Pitch))+pos.X);
*pDst = aColor.GetValue(); *pDst = aColor.GetValue();
mpSurface->UnlockRect(); mpSurface->UnlockRect();
#endif #endif
...@@ -780,7 +780,7 @@ namespace dxcanvas ...@@ -780,7 +780,7 @@ namespace dxcanvas
if(FAILED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL))) if(FAILED(mpSurface->Lock(NULL,&aSurfaceDesc,dwFlags,NULL)))
throw uno::RuntimeException(); throw uno::RuntimeException();
sal_uInt32 *pDst = (sal_uInt32 *)((((WIN_BYTE *)aSurfaceDesc.lpSurface)+(pos.Y*aSurfaceDesc.lPitch))+pos.X); sal_uInt32 *pDst = (sal_uInt32 *)((((BYTE *)aSurfaceDesc.lpSurface)+(pos.Y*aSurfaceDesc.lPitch))+pos.X);
Gdiplus::Color aColor(*pDst); Gdiplus::Color aColor(*pDst);
mpSurface->Unlock(NULL); mpSurface->Unlock(NULL);
#else #else
...@@ -789,7 +789,7 @@ namespace dxcanvas ...@@ -789,7 +789,7 @@ namespace dxcanvas
if(FAILED(mpSurface->LockRect(&aLockedRect,NULL,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY))) if(FAILED(mpSurface->LockRect(&aLockedRect,NULL,D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)))
throw uno::RuntimeException(); throw uno::RuntimeException();
sal_uInt32 *pDst = (sal_uInt32 *)((((WIN_BYTE *)aLockedRect.pBits)+(pos.Y*aLockedRect.Pitch))+pos.X); sal_uInt32 *pDst = (sal_uInt32 *)((((BYTE *)aLockedRect.pBits)+(pos.Y*aLockedRect.Pitch))+pos.X);
Gdiplus::Color aColor(*pDst); Gdiplus::Color aColor(*pDst);
mpSurface->UnlockRect(); mpSurface->UnlockRect();
#endif #endif
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
#undef WB_RIGHT #undef WB_RIGHT
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <tools/prewin.h> #include <windows.h> // TODO(Q1): extract minimal set of required headers for gdiplus
#if DIRECTX_VERSION < 0x0900 #if DIRECTX_VERSION < 0x0900
...@@ -107,8 +107,6 @@ using ::std::min; ...@@ -107,8 +107,6 @@ using ::std::min;
#include <gdiplus.h> #include <gdiplus.h>
#include <tools/postwin.h>
#ifdef min #ifdef min
# undef min # undef min
#endif #endif
...@@ -218,6 +216,12 @@ namespace dxcanvas ...@@ -218,6 +216,12 @@ namespace dxcanvas
#pragma warning(pop) #pragma warning(pop)
#endif #endif
#undef DELETE
#undef BOOL
#undef INT32
#undef UINT32
#undef PolyPolygon
#endif /* _DXCANVAS_WINSTUFF_HXX */ #endif /* _DXCANVAS_WINSTUFF_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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