mar: allow parallel creation of diff packages
[LibreOffice.git] / canvas / inc / rendering / isurfaceproxymanager.hxx
blob71b12b29e729dff3dd3d3b114dc3acb20db9c584
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
22 #include <canvas/canvastoolsdllapi.h>
23 #include <memory>
25 namespace canvas
27 struct ISurfaceProxy;
28 struct IColorBuffer;
29 struct IRenderModule;
31 /** Manager interface, which handles surface proxy objects.
33 Typically, each canvas instantiation has one
34 SurfaceProxyManager object, to handle their surfaces. Surfaces
35 itself are opaque objects, which encapsulate a framebuffer to
36 render upon, plus an optional (possibly accelerated) texture.
38 struct ISurfaceProxyManager
40 virtual ~ISurfaceProxyManager() {}
42 /** Create a surface proxy for a color buffer.
44 The whole idea is build around the concept that you create
45 some arbitrary buffer which contains the image data and
46 tell the texture manager about it. From there on you can
47 draw into this image using any kind of graphics api you
48 want. In the technical sense we allocate some space in
49 local videomemory or AGP memory which will be filled on
50 demand, which means if there exists any rendering
51 operation that needs to read from this memory location.
52 This method creates a logical hardware surface object
53 which uses the given color buffer as the image source.
54 Internally this texture may even be distributed to several
55 real hardware surfaces.
57 virtual std::shared_ptr< ISurfaceProxy > createSurfaceProxy(
58 const std::shared_ptr<IColorBuffer>& pBuffer ) const = 0;
61 /** Create a surface proxy for the given render module.
63 CANVASTOOLS_DLLPUBLIC std::shared_ptr<ISurfaceProxyManager> createSurfaceProxyManager( const std::shared_ptr<IRenderModule>& rRenderModule );
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */