summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_x11.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-06 12:35:02 +0200
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-06 12:35:02 +0200
commitebb539d3852658a104e6d59804ea9ad813f9e82d (patch)
tree463880587981051da456cc7cf8ca3e1bcbc0634c /src/gui/image/qpixmap_x11.cpp
parent32d6c5adb9d75ad7e3b2cef818f6b17d77d0f929 (diff)
parent40c8aba524831dd0d2f8dfcdf07797f5c2c47f5b (diff)
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (24 commits) QGLPixelBuffer should not rely on temporary QGLWidgets. Initialize pex. Remove warning. Fix the tests for the internal GL resource system. Rework how QGLTextureGlyphCache makes use of the resource system. The group pointer should no longer be a part of the 64 bit int. Enable glyph uploads from a thread in the X11 font engine. Make qt_pixmap_serial thread-safe. Clean up debug output. Clarification regarding the WA_X11InitThreads flag. Rework the internal GL resource system yet again. Check Qt::AA_X11InitThreads to determine pixmap usage in threads. Add an application attribute to control XInitThreads(). Unnecessary alloc + remove unused headers. QGLPixelBuffer should manage its own paint engines. Remove the DDS texture cache. Make the GL texture cache share textures between shared contexts. Redesigned how GL resource management works. Don't use the QGLSignalProxy to clean up the thread-local shaders. Simplify how the QGLEngineSharedShaders object is cleaned up. ...
Diffstat (limited to 'src/gui/image/qpixmap_x11.cpp')
-rw-r--r--src/gui/image/qpixmap_x11.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index e8dc5aeae0..afbfa35238 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -310,7 +310,7 @@ static int defaultScreen = -1;
QPixmap member functions
*****************************************************************************/
-static int qt_pixmap_serial = 0;
+QBasicAtomicInt qt_pixmap_serial = Q_BASIC_ATOMIC_INITIALIZER(0);
int Q_GUI_EXPORT qt_x11_preferred_pixmap_depth = 0;
QX11PixmapData::QX11PixmapData(PixelType type)
@@ -327,7 +327,7 @@ QPixmapData *QX11PixmapData::createCompatiblePixmapData() const
void QX11PixmapData::resize(int width, int height)
{
- setSerialNumber(++qt_pixmap_serial);
+ setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
w = width;
h = height;
@@ -410,7 +410,7 @@ struct QX11AlphaDetector
void QX11PixmapData::fromImage(const QImage &img,
Qt::ImageConversionFlags flags)
{
- setSerialNumber(++qt_pixmap_serial);
+ setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
w = img.width();
h = img.height();
@@ -1948,7 +1948,7 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform,
x11Data->hd = (Qt::HANDLE)XCreatePixmap(X11->display,
RootWindow(X11->display, xinfo.screen()),
w, h, d);
- x11Data->setSerialNumber(++qt_pixmap_serial);
+ x11Data->setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
#ifndef QT_NO_XRENDER
if (X11->use_xrender) {
@@ -2199,7 +2199,7 @@ void QX11PixmapData::copy(const QPixmapData *data, const QRect &rect)
const QX11PixmapData *x11Data = static_cast<const QX11PixmapData*>(data);
- setSerialNumber(++qt_pixmap_serial);
+ setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
flags &= ~Uninitialized;
xinfo = x11Data->xinfo;
@@ -2319,7 +2319,7 @@ QPixmap QPixmap::fromX11Pixmap(Qt::HANDLE pixmap, QPixmap::ShareMode mode)
}
QX11PixmapData *data = new QX11PixmapData(depth == 1 ? QPixmapData::BitmapType : QPixmapData::PixmapType);
- data->setSerialNumber(++qt_pixmap_serial);
+ data->setSerialNumber(qt_pixmap_serial.fetchAndAddRelaxed(1));
data->flags = QX11PixmapData::Readonly;
data->share_mode = mode;
data->w = width;