From a0d825133656c6329c0e7e3b0b6bafbd51e87271 Mon Sep 17 00:00:00 2001 From: Patrick Luby Date: Tue, 24 Jan 2023 20:28:22 -0500 Subject: tdf#147342 Notify Skia that the window's backing properties changed Change-Id: I4185a240a2ca6df1c92e86ff9950f86234d4ace8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146142 Tested-by: Jenkins Reviewed-by: Patrick Luby --- vcl/skia/gdiimpl.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'vcl/skia/gdiimpl.cxx') diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 15d901d93ff2..d0eb2ceaf51e 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -267,6 +267,7 @@ SkiaSalGraphicsImpl::SkiaSalGraphicsImpl(SalGraphics& rParent, SalGeometryProvid , mXorMode(XorMode::None) , mFlush(new SkiaFlushIdle(this)) , mScaling(1) + , mInWindowBackingPropertiesChanged(false) { } @@ -485,7 +486,7 @@ void SkiaSalGraphicsImpl::checkSurface() SAL_INFO("vcl.skia.trace", "create(" << this << "): " << Size(mSurface->width(), mSurface->height())); } - else if (GetWidth() * mScaling != mSurface->width() + else if (mInWindowBackingPropertiesChanged || GetWidth() * mScaling != mSurface->width() || GetHeight() * mScaling != mSurface->height()) { if (!avoidRecreateByResize()) @@ -2182,4 +2183,14 @@ void SkiaSalGraphicsImpl::dump(const char* file) const SkiaHelper::dump(mSurface, file); } +void SkiaSalGraphicsImpl::windowBackingPropertiesChanged() +{ + if (mInWindowBackingPropertiesChanged || !isGPU()) + return; + + mInWindowBackingPropertiesChanged = true; + performFlush(); + mInWindowBackingPropertiesChanged = false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit