LibreOffice Module canvas (master) 1
surfaceproxymanager.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <sal/config.h>
21
24
25#include "surfaceproxy.hxx"
26
27namespace canvas
28{
29 namespace {
30
31 class SurfaceProxyManager : public ISurfaceProxyManager
32 {
33 public:
34
35 explicit SurfaceProxyManager( const std::shared_ptr<IRenderModule>& rRenderModule ) :
36 mpPageManager( std::make_shared<PageManager>(rRenderModule) )
37 {
38 }
39
53 virtual std::shared_ptr<ISurfaceProxy> createSurfaceProxy( const std::shared_ptr<IColorBuffer>& pBuffer ) const override
54 {
55 // not much to do for now, simply allocate a new surface
56 // proxy from our internal pool and initialize this thing
57 // properly. we *don't* create a hardware surface for now.
58 return std::make_shared<SurfaceProxy>(pBuffer,mpPageManager);
59 }
60
61 private:
63 };
64
65 }
66
67 std::shared_ptr<ISurfaceProxyManager> createSurfaceProxyManager( const std::shared_ptr<IRenderModule>& rRenderModule )
68 {
69 return std::make_shared<SurfaceProxyManager>(rRenderModule);
70 }
71}
72
73/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< ISurfaceProxyManager > createSurfaceProxyManager(const std::shared_ptr< IRenderModule > &rRenderModule)
Create a surface proxy for the given render module.
std::shared_ptr< PageManager > PageManagerSharedPtr
Definition: pagemanager.hxx:73
std::shared_ptr< T > make_shared(Args &&... args)
PageManagerSharedPtr mpPageManager