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/.
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 _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
21 #define _SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
23 #include <svx/sdr/overlay/overlaymanager.hxx>
24 #include <basegfx/range/b2irange.hxx>
25 #include <vcl/virdev.hxx>
27 //////////////////////////////////////////////////////////////////////////////
33 class OverlayManagerBuffered
: public OverlayManager
36 // The VirtualDevice for draw window content buffering, this
37 // is the view content without overlay
38 VirtualDevice maBufferDevice
;
40 // #i73602# The VirtualDevice for OverlayPaint buffering. This
41 // is an extra device to avoid flickering of overlay paints
42 VirtualDevice maOutputBufferDevice
;
44 // Timer for buffering
47 // Range for buffering (in pixel to be independent from mapMode)
48 basegfx::B2IRange maBufferRememberedRangePixel
;
51 // Flag to decide if PreRendering shall be used for overlay refreshes.
53 unsigned mbRefreshWithPreRendering
: 1;
56 DECL_LINK(ImpBufferTimerHandler
, AutoTimer
*);
58 // Internal methods for buffering
59 void ImpPrepareBufferDevice();
60 void ImpRestoreBackground() const ;
61 void ImpRestoreBackground(const Region
& rRegionPixel
) const;
62 void ImpSaveBackground(const Region
& rRegion
, OutputDevice
* pPreRenderDevice
= 0L);
64 OverlayManagerBuffered(
65 OutputDevice
& rOutputDevice
,
66 bool bRefreshWithPreRendering
= false);
67 virtual ~OverlayManagerBuffered();
70 static rtl::Reference
<OverlayManager
> create(OutputDevice
& rOutputDevice
,
71 bool bRefreshWithPreRendering
= false);
74 virtual void completeRedraw(const Region
& rRegion
, OutputDevice
* pPreRenderDevice
= 0L) const;
76 // flush. Do buffered updates.
79 // #i68597# part of content gets copied, react on it
80 virtual void copyArea(const Point
& rDestPt
, const Point
& rSrcPt
, const Size
& rSrcSize
);
82 // restore part of background. Implemented form buffered versions only.
83 virtual void restoreBackground(const Region
& rRegion
) const;
85 // invalidate the given range at local OutputDevice
86 virtual void invalidateRange(const basegfx::B2DRange
& rRange
);
88 // access to RefreshWithPreRendering Flag
89 bool DoRefreshWithPreRendering() const { return mbRefreshWithPreRendering
; }
91 } // end of namespace overlay
92 } // end of namespace sdr
94 //////////////////////////////////////////////////////////////////////////////
96 #endif //_SDR_OVERLAY_OVERLAYMANAGERBUFFERED_HXX
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */