summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2012-01-23 10:41:53 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-01-27 17:49:12 (GMT)
commitfcb241b874330a045e5ba4634598476706ca7fdc (patch)
tree021079eba93c9ea23a30880bf431a1aad1ab1387
parentbd85d2bbb3ab9bff189ef70f86df8c2ad12e3c36 (diff)
downloadQt-fcb241b874330a045e5ba4634598476706ca7fdc.zip
Qt-fcb241b874330a045e5ba4634598476706ca7fdc.tar.gz
Qt-fcb241b874330a045e5ba4634598476706ca7fdc.tar.bz2
blitter: Kill the isBlitterLocked variable of the
It starts with being initialized wrongly, the call to buffer() will lock the data while we think it is not locked, it can also get out of sync by someone calling buffer() again. Remove the variable and check with the QBlittable if we need to lock the resource into memory. Change-Id: I6d7b336ed2e272724ec5b1348b410cbc4452422f Based-On: I350375011138d1b4c2c48c100b7b30b8ea2ae460 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
-rw-r--r--src/gui/painting/qblittable.cpp6
-rw-r--r--src/gui/painting/qblittable_p.h2
-rw-r--r--src/gui/painting/qpaintengine_blitter.cpp14
3 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/painting/qblittable.cpp b/src/gui/painting/qblittable.cpp
index a64396a..f7d994e 100644
--- a/src/gui/painting/qblittable.cpp
+++ b/src/gui/painting/qblittable.cpp
@@ -80,6 +80,12 @@ QSize QBlittable::size() const
return d->m_size;
}
+bool QBlittable::isLocked() const
+{
+ Q_D(const QBlittable);
+ return d->locked;
+}
+
QImage *QBlittable::lock()
{
Q_D(QBlittable);
diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h
index 2c7de9c..711c6b7 100644
--- a/src/gui/painting/qblittable_p.h
+++ b/src/gui/painting/qblittable_p.h
@@ -77,6 +77,8 @@ public:
virtual void fillRect(const QRectF &rect, const QColor &color) = 0;
virtual void drawPixmap(const QRectF &rect, const QPixmap &pixmap, const QRectF &subrect) = 0;
+ bool isLocked() const;
+
QImage *lock();
void unlock();
diff --git a/src/gui/painting/qpaintengine_blitter.cpp b/src/gui/painting/qpaintengine_blitter.cpp
index 1b7030f..e6b1060 100644
--- a/src/gui/painting/qpaintengine_blitter.cpp
+++ b/src/gui/painting/qpaintengine_blitter.cpp
@@ -189,7 +189,6 @@ public:
: QPaintEngineExPrivate()
, pmData(p)
, caps(pmData->blittable()->capabilities())
- , isBlitterLocked(false)
, hasXForm(false)
{
@@ -197,17 +196,12 @@ public:
}
inline void lock() {
- if (!isBlitterLocked) {
- raster->d_func()->rasterBuffer->prepare(pmData->blittable()->lock());
- isBlitterLocked = true;
- }
+ if (!pmData->blittable()->isLocked())
+ raster->d_func()->rasterBuffer->prepare(pmData->buffer());
}
inline void unlock() {
- if (isBlitterLocked) {
- pmData->blittable()->unlock();
- isBlitterLocked = false;
- }
+ pmData->blittable()->unlock();
}
void fillRect(const QRectF &rect, const QColor &color) {
@@ -276,8 +270,6 @@ public:
QBlittablePixmapData *pmData;
CapabilitiesToStateMask caps;
- bool isBlitterLocked;
-
uint hasXForm;
};