Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / svx / inc / sdr / overlay / overlaymanagerbuffered.hxx
blob1970131c75eed1bcfc414a9cbc9de7fae86d51da
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
21 #define INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
23 #include <svx/sdr/overlay/overlaymanager.hxx>
24 #include <basegfx/range/b2irange.hxx>
25 #include <vcl/virdev.hxx>
26 #include <vcl/idle.hxx>
29 namespace sdr
31 namespace overlay
33 class OverlayManagerBuffered final : public OverlayManager
35 // The VirtualDevice for draw window content buffering, this
36 // is the view content without overlay
37 ScopedVclPtr<VirtualDevice> mpBufferDevice;
39 // #i73602# The VirtualDevice for OverlayPaint buffering. This
40 // is an extra device to avoid flickering of overlay paints
41 ScopedVclPtr<VirtualDevice> mpOutputBufferDevice;
43 // Idle for buffering
44 Idle maBufferIdle;
46 // Range for buffering (in pixel to be independent from mapMode)
47 basegfx::B2IRange maBufferRememberedRangePixel;
49 // link for timer
50 DECL_LINK(ImpBufferTimerHandler, Timer*, void);
52 // Internal methods for buffering
53 void ImpPrepareBufferDevice();
54 void ImpRestoreBackground() const ;
55 void ImpRestoreBackground(const vcl::Region& rRegionPixel) const;
56 void ImpSaveBackground(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice);
58 OverlayManagerBuffered(OutputDevice& rOutputDevice);
59 virtual ~OverlayManagerBuffered() override;
61 public:
62 static rtl::Reference<OverlayManager> create(OutputDevice& rOutputDevice);
64 // complete redraw
65 virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const override;
67 // flush. Do buffered updates.
68 virtual void flush() override;
70 // invalidate the given range at local OutputDevice
71 virtual void invalidateRange(const basegfx::B2DRange& rRange) override;
73 } // end of namespace overlay
74 } // end of namespace sdr
77 #endif // INCLUDED_SVX_INC_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */