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/.
10 #include "bufferdevice.hxx"
14 BufferDevice::BufferDevice(const VclPtr
<vcl::Window
>& pWindow
, vcl::RenderContext
& rRenderContext
)
15 : m_pBuffer(VclPtr
<VirtualDevice
>::Create(rRenderContext
))
17 , m_rRenderContext(rRenderContext
)
19 m_pBuffer
->SetOutputSizePixel(pWindow
->GetOutputSizePixel(), false);
20 m_pBuffer
->SetTextColor(rRenderContext
.GetTextColor());
21 m_pBuffer
->DrawOutDev(Point(0, 0), pWindow
->GetOutputSizePixel(), Point(0, 0),
22 pWindow
->GetOutputSizePixel(), rRenderContext
);
23 m_pBuffer
->EnableRTL(rRenderContext
.IsRTLEnabled());
26 void BufferDevice::Dispose()
33 m_rRenderContext
.DrawOutDev(Point(0, 0), m_pWindow
->GetOutputSizePixel(), Point(0, 0),
34 m_pWindow
->GetOutputSizePixel(), *m_pBuffer
);
38 BufferDevice::~BufferDevice() { Dispose(); }
40 vcl::RenderContext
* BufferDevice::operator->() { return m_pBuffer
.get(); }
42 vcl::RenderContext
& BufferDevice::operator*() { return *m_pBuffer
; }
45 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */