diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-16 09:17:37 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-09-16 12:31:35 +0000 |
commit | 5096dd689db9fdd97ae0399f78f95710196b7786 (patch) | |
tree | 51a87cd2b9b4ff089a61e14d18bce32a062929d8 /include | |
parent | 3891bd40f6cf513a020ac6c87acfd0af7fc5ffd8 (diff) |
GL paint-flushing guard re-work.
Unfortunately, since we can have 2x SalGraphics' on a OutputDevice,
and one of these can be a printer - things got very confused around
which context to glFlush. This de-tangles the various reference-counts.
Conflicts:
vcl/inc/generic/genpspgraphics.h
vcl/win/source/gdi/salgdi.cxx
Change-Id: I1062be0b02a91fc9009deaa3ec29c5dbb227df20
Reviewed-on: https://gerrit.libreoffice.org/18611
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/outdev.hxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index f0057b3b54c0..dbd57e6ad339 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -608,9 +608,21 @@ public: const Point& rSrcPt, const Size& rSrcSize, bool bWindowInvalidate = false ); - // Call before and after a paint operation to reduce flushing - void BeginPaint(); - void EndPaint(); + /** + * Instantiate across a paint operation to defer flushing + * to the end. + * + * NB. holding a handle avoids problems with + * the underlying SalGraphics and it's implementation + * changing. + */ + class PaintScope { + void *pHandle; + public: + PaintScope(OutputDevice *); + ~PaintScope(); + void flush(); + }; protected: |