Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/image/qnativeimage.cpp

    r115 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5151#include <sys/shm.h>
    5252#include <qwidget.h>
     53
     54
     55
     56
    5357#endif
    5458
     
    6670QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool isTextBuffer, QWidget *)
    6771{
    68 #ifndef Q_OS_WINCE
     72#ifndef Q_S_WINCE
    6973    Q_UNUSED(isTextBuffer);
    7074#endif
     
    7983    if (format == QImage::Format_RGB16) {
    8084        bmi.bmiHeader.biBitCount = 16;
    81 #ifdef Q_OS_WINCE
     85#ifdef Q_S_WINCE
    8286        if (isTextBuffer) {
    8387            bmi.bmiHeader.biCompression = BI_RGB;
     
    117121    static_cast<QRasterPaintEngine *>(image.paintEngine())->setDC(hdc);
    118122
    119 #ifndef Q_OS_WINCE
     123#ifndef Q_S_WINCE
    120124    GdiFlush();
    121125#endif
     
    164168
    165169QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* isTextBuffer */, QWidget *widget)
     170
    166171{
    167172    if (!X11->use_mitshm) {
    168         xshmimg = 0;
    169         xshmpm = 0;
    170173        image = QImage(width, height, format);
     174
     175
     176
     177
     178
    171179        return;
    172180    }
     
    190198        xshmimg->data = (char*)shmat(xshminfo.shmid, 0, 0);
    191199        xshminfo.shmaddr = xshmimg->data;
     200
     201
    192202        ok = (xshminfo.shmaddr != (char*)-1);
    193203        if (ok)
     
    211221        return;
    212222    }
    213     xshmpm = XShmCreatePixmap(X11->display, DefaultRootWindow(X11->display), xshmimg->data,
    214                               &xshminfo, width, height, dd);
    215     if (!xshmpm) {
    216         qWarning() << "QNativeImage: Unable to create shared Pixmap.";
     223    if (X11->use_mitshm_pixmaps) {
     224        xshmpm = XShmCreatePixmap(X11->display, DefaultRootWindow(X11->display), xshmimg->data,
     225                                  &xshminfo, width, height, dd);
     226        if (!xshmpm) {
     227            qWarning() << "QNativeImage: Unable to create shared Pixmap.";
     228        }
    217229    }
    218230}
     
    245257#elif defined(Q_WS_MAC)
    246258
    247 QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool /* isTextBuffer */, QWidget *)
     259QNativeImage::QNativeImage(int width, int height, QImage::Format format, bool /* isTextBuffer */, QWidget *)
    248260    : image(width, height, format)
    249261{
    250     cgColorSpace = CGColorSpaceCreateDeviceRGB();
     262
     263
    251264    uint cgflags = kCGImageAlphaNoneSkipFirst;
    252265
    253266#ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version
    254     if(QSysInfo::MacintoshVersion >= QSysInfo::MV_10_4)
    255         cgflags |= kCGBitmapByteOrder32Host;
    256 #endif
    257 
    258     cg = CGBitmapContextCreate(image.bits(), width, height, 8, image.bytesPerLine(), cgColorSpace, cgflags);
     267   
     268#endif
     269
     270    cg = CGBitmapContextCreate(image.bits(), width, height, 8, image.bytesPerLine(),
     271    , cgflags);
    259272    CGContextTranslateCTM(cg, 0, height);
    260273    CGContextScaleCTM(cg, 1, -1);
     
    268281{
    269282    CGContextRelease(cg);
    270     CGColorSpaceRelease(cgColorSpace);
    271283}
    272284
Note: See TracChangeset for help on using the changeset viewer.