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 .
20 #ifndef INCLUDED_CANVAS_ISURFACEPROXYMANAGER_HXX
21 #define INCLUDED_CANVAS_ISURFACEPROXYMANAGER_HXX
23 #include <canvas/rendering/irendermodule.hxx>
24 #include <canvas/rendering/icolorbuffer.hxx>
26 #include <boost/shared_ptr.hpp>
28 #include <canvas/canvastoolsdllapi.h>
34 /** Manager interface, which handles surface proxy objects.
36 Typically, each canvas instantiation has one
37 SurfaceProxyManager object, to handle their surfaces. Surfaces
38 itself are opaque objects, which encapsulate a framebuffer to
39 render upon, plus an optional (possibly accelerated) texture.
41 struct ISurfaceProxyManager
43 virtual ~ISurfaceProxyManager() {}
45 /** Create a surface proxy for a color buffer.
47 The whole idea is build around the concept that you create
48 some arbitrary buffer which contains the image data and
49 tell the texture manager about it. From there on you can
50 draw into this image using any kind of graphics api you
51 want. In the technical sense we allocate some space in
52 local videomemory or AGP memory which will be filled on
53 demand, which means if there exists any rendering
54 operation that needs to read from this memory location.
55 This method creates a logical hardware surface object
56 which uses the given color buffer as the image source.
57 Internally this texture may even be distributed to several
58 real hardware surfaces.
60 virtual ::boost::shared_ptr
< ISurfaceProxy
> createSurfaceProxy(
61 const IColorBufferSharedPtr
& pBuffer
) const = 0;
64 typedef ::boost::shared_ptr
< ISurfaceProxyManager
> ISurfaceProxyManagerSharedPtr
;
67 /** Create a surface proxy for the given render module.
69 CANVASTOOLS_DLLPUBLIC ISurfaceProxyManagerSharedPtr
createSurfaceProxyManager( const IRenderModuleSharedPtr
& rRenderModule
);
72 #endif /* INCLUDED_CANVAS_ISURFACEPROXYMANAGER_HXX */
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */