INTEGRATION: CWS canvas05 (1.3.2); FILE MERGED
2008/06/03 23:52:23 thb 1.3.2.5: Removed extra level of indirection for getting a graphics for a surface; removed some unused code 2008/06/03 11:11:24 thb 1.3.2.4: Cleaned up image debugging stuff; fixed a few d3d debug warnings; fixed one deadlock rendering a bitmap from the same surface to itself; fixed premature ReleaseDC call in GraphicsProvider::getGraphics() 2008/04/21 07:29:36 thb 1.3.2.3: RESYNC: (1.3-1.4); FILE MERGED 2008/01/22 00:25:22 thb 1.3.2.2: #i81092# Making gdiplus and dx canvas more independent 2007/12/20 22:18:57 thb 1.3.2.1: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
* OpenOffice.org - a multi-platform office productivity suite
|
* OpenOffice.org - a multi-platform office productivity suite
|
||||||
*
|
*
|
||||||
* $RCSfile: dx_9rm.cxx,v $
|
* $RCSfile: dx_9rm.cxx,v $
|
||||||
* $Revision: 1.4 $
|
* $Revision: 1.5 $
|
||||||
*
|
*
|
||||||
* This file is part of OpenOffice.org.
|
* This file is part of OpenOffice.org.
|
||||||
*
|
*
|
||||||
@@ -28,6 +28,9 @@
|
|||||||
*
|
*
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
||||||
|
#include "precompiled_canvas.hxx"
|
||||||
|
|
||||||
#if DIRECTX_VERSION == 0x0900
|
#if DIRECTX_VERSION == 0x0900
|
||||||
|
|
||||||
#define MAX_TEXTURE_SIZE (2048)
|
#define MAX_TEXTURE_SIZE (2048)
|
||||||
@@ -49,6 +52,8 @@
|
|||||||
|
|
||||||
#include <canvas/debug.hxx>
|
#include <canvas/debug.hxx>
|
||||||
#include <canvas/verbosetrace.hxx>
|
#include <canvas/verbosetrace.hxx>
|
||||||
|
#include <tools/diagnose_ex.h>
|
||||||
|
|
||||||
#include <canvas/elapsedtime.hxx>
|
#include <canvas/elapsedtime.hxx>
|
||||||
#include <canvas/canvastools.hxx>
|
#include <canvas/canvastools.hxx>
|
||||||
#include <canvas/rendering/icolorbuffer.hxx>
|
#include <canvas/rendering/icolorbuffer.hxx>
|
||||||
@@ -64,7 +69,6 @@
|
|||||||
|
|
||||||
#include "dx_rendermodule.hxx"
|
#include "dx_rendermodule.hxx"
|
||||||
#include "dx_config.hxx"
|
#include "dx_config.hxx"
|
||||||
#include "dx_surfacegraphics.hxx"
|
|
||||||
|
|
||||||
#undef WB_LEFT
|
#undef WB_LEFT
|
||||||
#undef WB_RIGHT
|
#undef WB_RIGHT
|
||||||
@@ -73,9 +77,11 @@
|
|||||||
#include <vcl/sysdata.hxx>
|
#include <vcl/sysdata.hxx>
|
||||||
|
|
||||||
#if defined(DX_DEBUG_IMAGES)
|
#if defined(DX_DEBUG_IMAGES)
|
||||||
# include <imdebug.h>
|
# if OSL_DEBUG_LEVEL > 0
|
||||||
# undef min
|
# include <imdebug.h>
|
||||||
# undef max
|
# undef min
|
||||||
|
# undef max
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace ::com::sun::star;
|
using namespace ::com::sun::star;
|
||||||
@@ -328,7 +334,7 @@ namespace dxcanvas
|
|||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CHECK_AND_THROW(rSize.getX() > 0 && rSize.getY() > 0,
|
ENSURE_ARG_OR_THROW(rSize.getX() > 0 && rSize.getY() > 0,
|
||||||
"DXSurface::DXSurface(): request for zero-sized surface");
|
"DXSurface::DXSurface(): request for zero-sized surface");
|
||||||
|
|
||||||
COMReference<IDirect3DDevice9> pDevice(rRenderModule.getDevice());
|
COMReference<IDirect3DDevice9> pDevice(rRenderModule.getDevice());
|
||||||
@@ -538,7 +544,7 @@ namespace dxcanvas
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ENSURE_AND_RETURN(false,
|
ENSURE_OR_RETURN(false,
|
||||||
"DXSurface::update(): Unknown/unimplemented buffer format" );
|
"DXSurface::update(): Unknown/unimplemented buffer format" );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -626,7 +632,7 @@ namespace dxcanvas
|
|||||||
IDirect3DVertexBuffer9 *pVB(NULL);
|
IDirect3DVertexBuffer9 *pVB(NULL);
|
||||||
DWORD aFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
DWORD aFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1);
|
||||||
if( FAILED(mpDevice->CreateVertexBuffer(sizeof(dxvertex)*maNumVertices,
|
if( FAILED(mpDevice->CreateVertexBuffer(sizeof(dxvertex)*maNumVertices,
|
||||||
D3DUSAGE_DYNAMIC,
|
D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY,
|
||||||
aFVF,
|
aFVF,
|
||||||
D3DPOOL_DEFAULT,
|
D3DPOOL_DEFAULT,
|
||||||
&pVB,
|
&pVB,
|
||||||
@@ -703,7 +709,7 @@ namespace dxcanvas
|
|||||||
const HWND hwnd(reinterpret_cast<HWND>(pData->hWnd));
|
const HWND hwnd(reinterpret_cast<HWND>(pData->hWnd));
|
||||||
mhWnd = const_cast<HWND>(hwnd);
|
mhWnd = const_cast<HWND>(hwnd);
|
||||||
|
|
||||||
ENSURE_AND_THROW( IsWindow( reinterpret_cast<HWND>(mhWnd) ),
|
ENSURE_OR_THROW( IsWindow( reinterpret_cast<HWND>(mhWnd) ),
|
||||||
"DXRenderModule::create() No valid HWND given." );
|
"DXRenderModule::create() No valid HWND given." );
|
||||||
|
|
||||||
// retrieve position and size of the parent window
|
// retrieve position and size of the parent window
|
||||||
@@ -740,7 +746,7 @@ namespace dxcanvas
|
|||||||
|
|
||||||
bool DXRenderModule::verifyDevice( const UINT nAdapter )
|
bool DXRenderModule::verifyDevice( const UINT nAdapter )
|
||||||
{
|
{
|
||||||
ENSURE_AND_THROW( mpDirect3D9.is(),
|
ENSURE_OR_THROW( mpDirect3D9.is(),
|
||||||
"DXRenderModule::verifyDevice() No valid device." );
|
"DXRenderModule::verifyDevice() No valid device." );
|
||||||
|
|
||||||
// ask direct3d9 about the capabilities of hardware devices on a specific adapter.
|
// ask direct3d9 about the capabilities of hardware devices on a specific adapter.
|
||||||
@@ -797,11 +803,11 @@ namespace dxcanvas
|
|||||||
bool DXRenderModule::createDevice()
|
bool DXRenderModule::createDevice()
|
||||||
{
|
{
|
||||||
// we expect that the caller provides us with a valid HWND
|
// we expect that the caller provides us with a valid HWND
|
||||||
ENSURE_AND_THROW( IsWindow(mhWnd),
|
ENSURE_OR_THROW( IsWindow(mhWnd),
|
||||||
"DXRenderModule::createDevice() No valid HWND given." );
|
"DXRenderModule::createDevice() No valid HWND given." );
|
||||||
|
|
||||||
// we expect that the caller already created the direct3d9 object.
|
// we expect that the caller already created the direct3d9 object.
|
||||||
ENSURE_AND_THROW( mpDirect3D9.is(),
|
ENSURE_OR_THROW( mpDirect3D9.is(),
|
||||||
"DXRenderModule::createDevice() no direct3d?." );
|
"DXRenderModule::createDevice() no direct3d?." );
|
||||||
|
|
||||||
// find the adapter identifier from the window.
|
// find the adapter identifier from the window.
|
||||||
@@ -841,6 +847,7 @@ namespace dxcanvas
|
|||||||
sal_Int32(d3ddm.Width));
|
sal_Int32(d3ddm.Width));
|
||||||
mad3dpp.BackBufferHeight = std::max(sal_Int32(maSize.getY()),
|
mad3dpp.BackBufferHeight = std::max(sal_Int32(maSize.getY()),
|
||||||
sal_Int32(d3ddm.Height));
|
sal_Int32(d3ddm.Height));
|
||||||
|
mad3dpp.BackBufferCount = 1;
|
||||||
mad3dpp.Windowed = TRUE;
|
mad3dpp.Windowed = TRUE;
|
||||||
mad3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
|
mad3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
|
||||||
mad3dpp.BackBufferFormat = d3ddm.Format;
|
mad3dpp.BackBufferFormat = d3ddm.Format;
|
||||||
@@ -1078,7 +1085,7 @@ namespace dxcanvas
|
|||||||
if(isDisposed())
|
if(isDisposed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ENSURE_AND_THROW( !mnBeginSceneCount,
|
ENSURE_OR_THROW( !mnBeginSceneCount,
|
||||||
"DXRenderModule::beginPrimitive(): nested call" );
|
"DXRenderModule::beginPrimitive(): nested call" );
|
||||||
|
|
||||||
++mnBeginSceneCount;
|
++mnBeginSceneCount;
|
||||||
|
Reference in New Issue
Block a user