1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_canvas.hxx"
31 #include <canvas/rendering/isurfaceproxymanager.hxx>
32 #include <canvas/rendering/isurfaceproxy.hxx>
33 #include "surfaceproxy.hxx"
38 //////////////////////////////////////////////////////////////////////////////////
39 // SurfaceProxyManager
40 //////////////////////////////////////////////////////////////////////////////////
42 class SurfaceProxyManager
: public ISurfaceProxyManager
46 SurfaceProxyManager( const IRenderModuleSharedPtr pRenderModule
) :
47 mpPageManager( new PageManager(pRenderModule
) )
51 /** the whole idea is build around the concept that you create
52 some arbitrary buffer which contains the image data and
53 tell the texture manager about it. from there on you can
54 draw this image using any kind of graphics api you want.
55 in the technical sense we allocate some space in local
56 videomemory or AGP memory which will be filled on demand,
57 which means if there exists any rendering operation that
58 needs to read from this memory location. this method
59 creates a logical hardware surface object which uses the
60 given color buffer as the image source. internally this
61 texture may be distributed to several real hardware
64 virtual ISurfaceProxySharedPtr
createSurfaceProxy( const IColorBufferSharedPtr
& pBuffer
) const
66 // not much to do for now, simply allocate a new surface
67 // proxy from our internal pool and initialize this thing
68 // properly. we *don't* create a hardware surface for now.
69 return SurfaceProxySharedPtr(new SurfaceProxy(pBuffer
,mpPageManager
));
73 PageManagerSharedPtr mpPageManager
;
76 //////////////////////////////////////////////////////////////////////////////////
77 // createSurfaceProxyManager
78 //////////////////////////////////////////////////////////////////////////////////
80 ISurfaceProxyManagerSharedPtr
createSurfaceProxyManager( const IRenderModuleSharedPtr
& rRenderModule
)
82 return ISurfaceProxyManagerSharedPtr(
83 new SurfaceProxyManager(