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.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-05-07 09:18:27 +02:00 committed by Noel Grandin
parent 2a8401f616
commit a93220b79f

View file

@ -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())
{