Avoid potential negative array index access to cached text.
[LibreOffice.git] / vcl / inc / qt5 / QtSvpSurface.hxx
blobd86553643e769f38d6a32ac9357a433d9874c168
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/.
8 */
10 #pragma once
12 #include <sal/config.h>
14 #include <vcl/cairo.hxx>
16 class QtSvpGraphics;
17 class OutputDevice;
19 namespace cairo
21 class QtSvpSurface final : public Surface
23 const QtSvpGraphics* m_pGraphics;
24 cairo_t* const m_pCairoContext;
25 CairoSurfaceSharedPtr m_pSurface;
27 public:
28 /// takes over ownership of passed cairo_surface
29 explicit QtSvpSurface(CairoSurfaceSharedPtr pSurface);
30 /// create surface on subarea of given drawable
31 explicit QtSvpSurface(const QtSvpGraphics* pGraphics, int x, int y, int width, int height);
32 ~QtSvpSurface() override;
34 // Surface interface
35 CairoSharedPtr getCairo() const override;
36 CairoSurfaceSharedPtr getCairoSurface() const override { return m_pSurface; }
37 SurfaceSharedPtr getSimilar(int nContentType, int width, int height) const override;
39 VclPtr<VirtualDevice> createVirtualDevice() const override;
40 void flush() const override;
44 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */