From d9e872114fcb1beedf2f068d19bd4eda1854073a Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 17 Aug 2015 14:04:57 +0200 Subject: tdf#93482 vcl rendercontext: introduce WindowImpl::mbDoubleBufferingRequested The intention is that currently double-buffering is either enabled globally or not. Double-buffering is known to be working in Writer, but not in other applications, so it would be nice if double-buffering could be also half-enabled: only in the applications where it's known to work. For that, we need to differentiate between "we have a buffer" (supports double buffering) and "we want to have a buffer if possible" (double buffering requested). Change-Id: If48d6dc0ddf5841497e78b856d803cc8abf23ac9 --- vcl/inc/window.h | 2 +- vcl/source/window/window.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 8b5cf9cc7f39..2e56cc77e71e 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -376,7 +376,7 @@ public: mbFill:1, mbSecondary:1, mbNonHomogeneous:1, - mbDoubleBuffering:1; + mbDoubleBufferingRequested:1; vcl::RenderSettings maRenderSettings; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 7dce25b0f525..35b4f06ff738 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -757,7 +757,7 @@ WindowImpl::WindowImpl( WindowType nType ) mbFill = true; mbSecondary = false; mbNonHomogeneous = false; - mbDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_FORCE_ENABLE"); // when we are not sure, assume it cannot do double-buffering via RenderContext + mbDoubleBufferingRequested = getenv("VCL_DOUBLEBUFFERING_FORCE_ENABLE"); // when we are not sure, assume it cannot do double-buffering via RenderContext } WindowImpl::~WindowImpl() @@ -1074,7 +1074,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p mpWindowImpl->mpFrameData->maResizeIdle.SetIdleHdl( LINK( this, Window, ImplHandleResizeTimerHdl ) ); mpWindowImpl->mpFrameData->maResizeIdle.SetDebugName( "vcl::Window maResizeIdle" ); mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = false; - if (!(nStyle & WB_DEFAULTWIN) && SupportsDoubleBuffering()) + if (!(nStyle & WB_DEFAULTWIN) && mpWindowImpl->mbDoubleBufferingRequested) mpWindowImpl->mpFrameData->mpBuffer = VclPtrInstance(); mpWindowImpl->mpFrameData->mbInBufferedPaint = false; @@ -3905,7 +3905,7 @@ Any Window::GetSystemDataAny() const bool Window::SupportsDoubleBuffering() const { - return mpWindowImpl->mbDoubleBuffering; + return mpWindowImpl->mpFrameData->mpBuffer; } /* -- cgit v1.2.3