summaryrefslogtreecommitdiffstats
path: root/include/vcl/outdev.hxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-09-16 09:17:37 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-09-16 09:50:43 +0000
commitbfceb557efcd607ef018ae35fc73f8d61a9b9a4e (patch)
tree7f46254e93f12bc3b96cb49fa52afa97a855c2e3 /include/vcl/outdev.hxx
parenttdf#94213 - cleanup associated GL contexts properly when DCs released. (diff)
downloadcore-bfceb557efcd607ef018ae35fc73f8d61a9b9a4e.tar.gz
core-bfceb557efcd607ef018ae35fc73f8d61a9b9a4e.zip
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. Change-Id: I1062be0b02a91fc9009deaa3ec29c5dbb227df20 Reviewed-on: https://gerrit.libreoffice.org/18604 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'include/vcl/outdev.hxx')
-rw-r--r--include/vcl/outdev.hxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c8ba06a112fe..20bd81ae197f 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -606,9 +606,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: