Kaydet (Commit) 67b2edc2 authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Andras Timar

rendercontext: Make the Gtk+ native widgets work with double-buffering.

Change-Id: Ic7101ab7cbaa7fd5f6b073a73ef0c0088b1af4c6
Reviewed-on: https://gerrit.libreoffice.org/15980Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAdolfo Jayme Barrientos <fitojb@ubuntu.com>
üst 895fbcff
......@@ -246,11 +246,12 @@ enum class ControlState {
HIDDEN = 0x0010,
DEFAULT = 0x0020,
SELECTED = 0x0040,
CACHING_ALLOWED = 0x8000, // set when the control is completely visible (i.e. not clipped)
DOUBLEBUFFERING = 0x4000, ///< Set when the control is painted using double-buffering via VirtualDevice.
CACHING_ALLOWED = 0x8000, ///< Set when the control is completely visible (i.e. not clipped).
};
namespace o3tl
{
template<> struct typed_flags<ControlState> : is_typed_flags<ControlState, 0x8007f> {};
template<> struct typed_flags<ControlState> : is_typed_flags<ControlState, 0xc007f> {};
}
/* ButtonValue:
......
......@@ -18,6 +18,7 @@
*/
#include <vcl/outdev.hxx>
#include <vcl/virdev.hxx>
#include <vcl/window.hxx>
#include <vcl/salnativewidgets.hxx>
......@@ -300,6 +301,9 @@ bool OutputDevice::DrawNativeControl( ControlType nType,
if (aTestRegion == vcl::Region(rControlRegion))
nState |= ControlState::CACHING_ALLOWED; // control is not clipped, caching allowed
if (dynamic_cast<VirtualDevice*>(this))
nState |= ControlState::DOUBLEBUFFERING;
bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this );
return bRet;
......
......@@ -860,12 +860,9 @@ bool GtkSalGraphics::hitTestNativeControl( ControlType nType,
* aValue: An optional value (tristate/numerical/string)
* rCaption: A caption or title string (like button text etc)
*/
bool GtkSalGraphics::drawNativeControl( ControlType nType,
ControlPart nPart,
const Rectangle& rControlRegion,
ControlState nState,
const ImplControlValue& aValue,
const OUString& rCaption )
bool GtkSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const OUString& rCaption)
{
// get a GC with current clipping region set
GetFontGC();
......@@ -891,7 +888,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType,
std::unique_ptr<GdkX11Pixmap> xPixmap;
std::unique_ptr<GdkX11Pixmap> xMask;
Rectangle aPixmapRect;
if( ( bNeedPixmapPaint )
if ((bNeedPixmapPaint || (nState & ControlState::DOUBLEBUFFERING))
&& nType != CTRL_SCROLLBAR
&& nType != CTRL_SPINBOX
&& nType != CTRL_TAB_ITEM
......
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