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/painting/qmemrotate.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    529529}
    530530
     531#define QT_IMPL_SIMPLE_MEMROTATE(srctype, desttype)                 \
     532void qt_memrotate90(const srctype *src, int w, int h, int sstride,  \
     533                    desttype *dest, int dstride)                    \
     534{                                                                   \
     535    qt_memrotate90_tiled_unpacked<desttype,srctype>(src, w, h, sstride, dest, dstride); \
     536}                                                                   \
     537void qt_memrotate180(const srctype *src, int w, int h, int sstride, \
     538                     desttype *dest, int dstride)                   \
     539{                                                                   \
     540    qt_memrotate180_template(src, w, h, sstride, dest, dstride);    \
     541}                                                                   \
     542void qt_memrotate270(const srctype *src, int w, int h, int sstride, \
     543                     desttype *dest, int dstride)                   \
     544{                                                                   \
     545    qt_memrotate270_tiled_unpacked<desttype,srctype>(src, w, h, sstride, dest, dstride); \
     546}
     547
     548
     549
     550
    531551QT_IMPL_MEMROTATE(quint32, quint32)
    532552QT_IMPL_MEMROTATE(quint32, quint16)
     
    538558QT_IMPL_MEMROTATE(quint32, quint8)
    539559QT_IMPL_MEMROTATE(quint16, quint8)
     560QT_IMPL_MEMROTATE(qrgb444, quint8)
    540561QT_IMPL_MEMROTATE(quint8, quint8)
     562
     563#if defined(QT_QWS_ROTATE_BGR)
     564QT_IMPL_SIMPLE_MEMROTATE(quint16, qbgr565)
     565QT_IMPL_SIMPLE_MEMROTATE(quint32, qbgr565)
     566QT_IMPL_SIMPLE_MEMROTATE(qrgb555, qbgr555)
     567QT_IMPL_SIMPLE_MEMROTATE(quint32, qbgr555)
     568#endif
     569
    541570#ifdef QT_QWS_DEPTH_GENERIC
    542571QT_IMPL_MEMROTATE(quint32, qrgb_generic16)
     
    544573#endif
    545574
     575struct qrgb_gl_rgba
     576{
     577public:
     578    inline qrgb_gl_rgba(quint32 v) {
     579        if (QSysInfo::ByteOrder == QSysInfo::LittleEndian)
     580            data = ((v << 16) & 0xff0000) | ((v >> 16) & 0xff) | (v & 0xff00ff00);
     581        else
     582            data = (v << 8) | ((v >> 24) & 0xff);
     583    }
     584
     585    inline operator quint32() const { return data; }
     586
     587private:
     588    quint32 data;
     589} Q_PACKED;
     590
     591void Q_GUI_EXPORT qt_memrotate90_gl(const quint32 *src, int srcWidth, int srcHeight, int srcStride,
     592                                    quint32 *dest, int dstStride)
     593{
     594    qt_memrotate90_template(src, srcWidth, srcHeight, srcStride, reinterpret_cast<qrgb_gl_rgba *>(dest), dstStride);
     595}
    546596
    547597QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.