Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / vcl / source / window / bufferdevice.cxx
blobd1480588d48f90b57702bbc8b7185c8cad2c4eba
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 #include "bufferdevice.hxx"
12 namespace vcl
14 BufferDevice::BufferDevice(const VclPtr<vcl::Window>& pWindow, vcl::RenderContext& rRenderContext)
15 : m_pBuffer(VclPtr<VirtualDevice>::Create(rRenderContext))
16 , m_pWindow(pWindow)
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);
25 BufferDevice::~BufferDevice()
27 m_rRenderContext.DrawOutDev(Point(0, 0), m_pWindow->GetOutputSizePixel(), Point(0, 0),
28 m_pWindow->GetOutputSizePixel(), *m_pBuffer);
31 vcl::RenderContext* BufferDevice::operator->() { return m_pBuffer.get(); }
33 vcl::RenderContext& BufferDevice::operator*() { return *m_pBuffer; }
36 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */