drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit a93220b79faad8d679f3c67ccd967cdfac68d49f
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat May 7 09:18:27 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat May 7 14:21:58 2022 +0200

    osl::Mutex->std::mutex in VDevBuffer
    
    Change-Id: I64b48e60f178574a0e0382e72a002a87320bbf39
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133972
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx 
b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
index 24e0c6a30bcb..c19dd965755a 100644
--- a/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
+++ b/drawinglayer/source/processor2d/vclhelperbufferdevice.cxx
@@ -30,16 +30,16 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <tools/stream.hxx>
 #include <vcl/timer.hxx>
-#include <cppuhelper/basemutex.hxx>
 #include <vcl/lazydelete.hxx>
 #include <vcl/dibtools.hxx>
 #include <vcl/skia/SkiaHelper.hxx>
+#include <mutex>
 
 // buffered VDev usage
 
 namespace
 {
-class VDevBuffer : public Timer, protected cppu::BaseMutex
+class VDevBuffer : public Timer
 {
 private:
     struct Entry
@@ -53,6 +53,8 @@ private:
         }
     };
 
+    std::mutex m_aMutex;
+
     // available buffers
     std::vector<Entry> maFreeBuffers;
 
@@ -85,7 +87,7 @@ VDevBuffer::VDevBuffer()
 
 VDevBuffer::~VDevBuffer()
 {
-    ::osl::MutexGuard aGuard(m_aMutex);
+    std::unique_lock aGuard(m_aMutex);
     Stop();
 
     while (!maFreeBuffers.empty())
@@ -132,7 +134,7 @@ bool VDevBuffer::isSizeSuitable(const 
VclPtr<VirtualDevice>& device, const Size&
 VclPtr<VirtualDevice> VDevBuffer::alloc(OutputDevice& rOutDev, const Size& 
rSizePixel,
                                         bool bTransparent)
 {
-    ::osl::MutexGuard aGuard(m_aMutex);
+    std::unique_lock aGuard(m_aMutex);
     VclPtr<VirtualDevice> pRetval;
 
     sal_Int32 nBits = rOutDev.GetBitCount();
@@ -248,7 +250,7 @@ VclPtr<VirtualDevice> VDevBuffer::alloc(OutputDevice& 
rOutDev, const Size& rSize
 
 void VDevBuffer::free(VirtualDevice& rDevice)
 {
-    ::osl::MutexGuard aGuard(m_aMutex);
+    std::unique_lock aGuard(m_aMutex);
     const auto aUsedFound
         = std::find_if(maUsedBuffers.begin(), maUsedBuffers.end(),
                        [&rDevice](const Entry& el) { return el.buf == 
&rDevice; });
@@ -266,7 +268,7 @@ void VDevBuffer::free(VirtualDevice& rDevice)
 
 void VDevBuffer::Invoke()
 {
-    ::osl::MutexGuard aGuard(m_aMutex);
+    std::unique_lock aGuard(m_aMutex);
 
     while (!maFreeBuffers.empty())
     {

Reply via email to