summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-05-18 18:30:44 +0200
committerJan Holesovsky <kendy@collabora.com>2015-05-18 18:34:15 +0200
commit0fc56aad09861a6d94246a3fa047fef70c79f8d9 (patch)
tree389afbf233ea02712477669d060e02612451a2c8
parent36b06104f7955f6f39fd87f175e8f9482695ae0b (diff)
rendercontext: Per-widget double-buffering for the cases we know that work.
Uses a variable, not a virtual method, as any change would need a large re-compile. Change-Id: I103669b139a82137c5d346ab8c9459483d358f2b
-rw-r--r--include/vcl/window.hxx5
-rw-r--r--vcl/inc/window.h3
-rw-r--r--vcl/source/window/paint.cxx4
-rw-r--r--vcl/source/window/window.cxx11
4 files changed, 20 insertions, 3 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index f7615e331a11..c86ecb8d7daa 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -785,6 +785,11 @@ public:
bool IsDisposed() const;
SystemWindow* GetSystemWindow() const;
+ /// Can the widget derived from this Window do the double-buffering via RenderContext properly?
+ bool SupportsDoubleBuffering() const;
+ /// Mark this window / widget derived from this window as working with double-buffering via RenderContext.
+ void SetDoubleBuffering(bool bDoubleBuffering = true);
+
void EnableAllResize( bool bEnable = true );
void SetBorderStyle( WindowBorderStyle nBorderStyle );
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index d73f3e10a3bc..48fea9eb74d8 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -368,7 +368,8 @@ public:
mbExpand:1,
mbFill:1,
mbSecondary:1,
- mbNonHomogeneous:1;
+ mbNonHomogeneous:1,
+ mbDoubleBuffering:1;
vcl::RenderSettings maRenderSettings;
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 2ee0dbac3b5c..4f7f9ddabc93 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -124,8 +124,8 @@ void PaintHelper::DoPaint(const vcl::Region* pRegion)
{
m_pWindow->BeginPaint();
- // double-buffering - so far an experimental feature
- if (officecfg::Office::Common::Misc::ExperimentalMode::get())
+ // double-buffering: normally just a selected subset
+ if (m_pWindow->SupportsDoubleBuffering() || officecfg::Office::Common::Misc::ExperimentalMode::get())
{
m_pWindow->PushPaintHelper(this, *m_pWindow);
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 730cb0309cfb..34aa2856fdac 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -751,6 +751,7 @@ WindowImpl::WindowImpl( WindowType nType )
mbFill = true;
mbSecondary = false;
mbNonHomogeneous = false;
+ mbDoubleBuffering = false; // when we are not sure, assume it cannot do double-buffering via RenderContext
}
WindowImpl::~WindowImpl()
@@ -3935,6 +3936,16 @@ vcl::RenderSettings& Window::GetRenderSettings()
return mpWindowImpl->maRenderSettings;
}
+bool Window::SupportsDoubleBuffering() const
+{
+ return mpWindowImpl->mbDoubleBuffering;
+}
+
+void Window::SetDoubleBuffering(bool bDoubleBuffering)
+{
+ mpWindowImpl->mbDoubleBuffering = bDoubleBuffering;
+}
+
} /* namespace vcl */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */