From 6032dae9b426ac2ddefd976540a84f7cd6a325ed Mon Sep 17 00:00:00 2001 From: Mailson Menezes Date: Wed, 10 Oct 2012 17:35:55 -0300 Subject: [PATCH] Remove request mutex This mutex at tiles manager is not actually necessary since any of the related code will run on a different thread. --- core/tilesmanager.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/core/tilesmanager.cpp b/core/tilesmanager.cpp index 1fbf527c5..9058b867b 100644 --- a/core/tilesmanager.cpp +++ b/core/tilesmanager.cpp @@ -65,7 +65,6 @@ class TilesManager::Private NormalizedRect requestRect; int requestWidth; int requestHeight; - QMutex requestMutex; QList rankedTiles; }; @@ -124,14 +123,12 @@ void TilesManager::setWidth( int width ) if ( width == d->width ) return; - d->requestMutex.lock(); d->width = width; for ( int i = 0; i < 16; ++i ) { d->markDirty( d->tiles[ i ] ); } - d->requestMutex.unlock(); } int TilesManager::width() const { @@ -143,9 +140,7 @@ void TilesManager::setHeight( int height ) if ( height == d->height ) return; - d->requestMutex.lock(); d->height = height; - d->requestMutex.unlock(); } int TilesManager::height() const { @@ -195,14 +190,10 @@ NormalizedRect TilesManager::visibleRect() const void TilesManager::setPixmap( const QPixmap *pixmap, const NormalizedRect &rect ) { - d->requestMutex.lock(); if ( !d->requestRect.isNull() ) { if ( !(d->requestRect == rect) || rect.geometry( width(), height() ).size() != pixmap->size() ) - { - d->requestMutex.unlock(); return; - } d->requestRect = NormalizedRect(); } @@ -211,7 +202,6 @@ void TilesManager::setPixmap( const QPixmap *pixmap, const NormalizedRect &rect { d->setPixmap( pixmap, fromRotatedRect( rect, d->rotation ), d->tiles[ i ] ); } - d->requestMutex.unlock(); } void TilesManager::Private::setPixmap( const QPixmap *pixmap, const NormalizedRect &rect, Tile &tile ) @@ -472,11 +462,9 @@ bool TilesManager::isRequesting( const NormalizedRect &rect, int pageWidth, int void TilesManager::setRequest( const NormalizedRect &rect, int pageWidth, int pageHeight ) { - d->requestMutex.lock(); d->requestRect = rect; d->requestWidth = pageWidth; d->requestHeight = pageHeight; - d->requestMutex.unlock(); } void TilesManager::Private::split( Tile &tile, const NormalizedRect &rect )