Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/vcl/inc/headless/svpvd.hxx
Line
Count
Source
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
#pragma once
21
22
#include <salvd.hxx>
23
#include <basegfx/vector/b2ivector.hxx>
24
25
#include <vector>
26
27
class SvpSalGraphics;
28
typedef struct _cairo_surface cairo_surface_t;
29
30
class VCL_DLLPUBLIC SvpSalVirtualDevice : public SalVirtualDevice
31
{
32
    cairo_surface_t*                    m_pRefSurface;
33
    cairo_surface_t*                    m_pSurface;
34
    bool                                m_bOwnsSurface; // nearly always true, except for edge case of tdf#127529
35
    basegfx::B2IVector                  m_aFrameSize;
36
    std::vector< SvpSalGraphics* >      m_aGraphics;
37
38
    bool CreateSurface(tools::Long nNewDX, tools::Long nNewDY, sal_uInt8 *const pBuffer);
39
    bool CreateSurface(tools::Long nNewDX, tools::Long nNewDY, bool bAlphaMaskTransparent = false);
40
41
protected:
42
    SvpSalGraphics* AddGraphics(SvpSalGraphics* aGraphics);
43
44
public:
45
    SvpSalVirtualDevice(cairo_surface_t* pRefSurface, cairo_surface_t* pPreExistingTarget);
46
    virtual ~SvpSalVirtualDevice() override;
47
48
    // SalVirtualDevice
49
    virtual SalGraphics*    AcquireGraphics() override;
50
    virtual void            ReleaseGraphics( SalGraphics* pGraphics ) override;
51
52
    virtual bool        SetSize( tools::Long nNewDX, tools::Long nNewDY, bool bAlphaMaskTransparent ) override;
53
    virtual bool        SetSizeUsingBuffer( tools::Long nNewDX, tools::Long nNewDY,
54
                                            sal_uInt8 * pBuffer) override;
55
56
0
    cairo_surface_t* GetSurface() const { return m_pSurface; }
57
58
    // SalGeometryProvider
59
    virtual tools::Long GetWidth() const override;
60
    virtual tools::Long GetHeight() const override;
61
};
62
63
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */