Kaydet (Commit) 0fc56aad authored tarafından Jan Holesovsky's avatar Jan Holesovsky

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
üst 36b06104
......@@ -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 );
......
......@@ -368,7 +368,8 @@ public:
mbExpand:1,
mbFill:1,
mbSecondary:1,
mbNonHomogeneous:1;
mbNonHomogeneous:1,
mbDoubleBuffering:1;
vcl::RenderSettings maRenderSettings;
......
......@@ -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);
......
......@@ -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: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment