1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <canvas/rendering/isurfaceproxymanager.hxx>
22 #include <canvas/rendering/isurfaceproxy.hxx>
23 #include "surfaceproxy.hxx"
29 // SurfaceProxyManager
32 class SurfaceProxyManager
: public ISurfaceProxyManager
36 SurfaceProxyManager( const IRenderModuleSharedPtr
& rRenderModule
) :
37 mpPageManager( new PageManager(rRenderModule
) )
41 /** the whole idea is build around the concept that you create
42 some arbitrary buffer which contains the image data and
43 tell the texture manager about it. from there on you can
44 draw this image using any kind of graphics api you want.
45 in the technical sense we allocate some space in local
46 videomemory or AGP memory which will be filled on demand,
47 which means if there exists any rendering operation that
48 needs to read from this memory location. this method
49 creates a logical hardware surface object which uses the
50 given color buffer as the image source. internally this
51 texture may be distributed to several real hardware
54 virtual ISurfaceProxySharedPtr
createSurfaceProxy( const IColorBufferSharedPtr
& pBuffer
) const SAL_OVERRIDE
56 // not much to do for now, simply allocate a new surface
57 // proxy from our internal pool and initialize this thing
58 // properly. we *don't* create a hardware surface for now.
59 return SurfaceProxySharedPtr(new SurfaceProxy(pBuffer
,mpPageManager
));
63 PageManagerSharedPtr mpPageManager
;
67 // createSurfaceProxyManager
70 ISurfaceProxyManagerSharedPtr
createSurfaceProxyManager( const IRenderModuleSharedPtr
& rRenderModule
)
72 return ISurfaceProxyManagerSharedPtr(
73 new SurfaceProxyManager(
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */