~ubuntu-branches/ubuntu/precise/qt4-x11/precise-proposed

« back to all changes in this revision

Viewing changes to src/gui/image/qnativeimage.cpp

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2011-09-29 13:31:46 UTC
  • Revision ID: package-import@ubuntu.com-20110929133146-r3ozrkjk4aywnesy
Tags: 4:4.7.4-0ubuntu7
* debian/patches/kubuntu_96_fix_qml_crash.diff:
  - unity-2d-panel crashed with SIGSEGV in QPainter::drawTiledPixmap()
    (LP: #804784)
  - unity-2d-launcher crashed with SIGSEGV in QPainter::fillRect()
    (LP: #805587)

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* isTextBuffer */, QWidget *widget)
151
151
    : xshmimg(0), xshmpm(0)
152
152
{
153
 
    if (!X11->use_mitshm) {
 
153
    QX11Info info = widget->x11Info();
 
154
    
 
155
    int dd = info.depth();
 
156
    Visual *vis = (Visual*) info.visual();
 
157
   
 
158
    if (!X11->use_mitshm || format != QImage::Format_RGB16 && X11->bppForDepth.value(dd) != 32) {
154
159
        image = QImage(width, height, format);
155
160
        // follow good coding practice and set xshminfo attributes, though values not used in this case
156
161
        xshminfo.readOnly = true;
160
165
        return;
161
166
    }
162
167
 
163
 
    QX11Info info = widget->x11Info();
164
 
 
165
 
    int dd = info.depth();
166
 
    Visual *vis = (Visual*) info.visual();
167
 
 
168
168
    xshmimg = XShmCreateImage(X11->display, vis, dd, ZPixmap, 0, &xshminfo, width, height);
169
169
    if (!xshmimg) {
170
170
        qWarning("QNativeImage: Unable to create shared XImage.");